|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Copyright 2025 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -euox pipefail |
| 18 | + |
| 19 | +install_kind() { |
| 20 | + if ! command -v kind &>/dev/null; then |
| 21 | + echo "kind not found, installing..." |
| 22 | + [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64 |
| 23 | + # For ARM64 |
| 24 | + [ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-arm64 |
| 25 | + chmod +x ./kind |
| 26 | + mv ./kind /usr/local/bin/kind |
| 27 | + else |
| 28 | + echo "kind is already installed." |
| 29 | + fi |
| 30 | +} |
| 31 | + |
| 32 | +if kubectl config current-context >/dev/null 2>&1; then |
| 33 | + echo "Active kubecontext found. Running Go e2e tests in ./epp..." |
| 34 | +else |
| 35 | + install_kind |
| 36 | + kind create cluster --name inference-e2e |
| 37 | + KIND_CLUSTER=inference-e2e make image-kind |
| 38 | + # Add the Gateway API CRDs |
| 39 | + VERSION=v0.3.0 |
| 40 | + echo "Kind cluster created. Running Go e2e tests in ./epp..." |
| 41 | +fi |
| 42 | + |
| 43 | +go test ./test/e2e/epp/ -v -ginkgo.v |
0 commit comments