Skip to content

Commit b44e2e7

Browse files
Add scripts for running e2es (#978) (#1027)
* Add scripts for running e2es * Only export some * Move e2e script to hack * Trigger CI * Install kind and add boilerplate * No sudo --------- Signed-off-by: Keith Mattix II <[email protected]> Co-authored-by: Keith Mattix II <[email protected]>
1 parent a8d9469 commit b44e2e7

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ test-integration: ## Run integration tests.
138138

139139
.PHONY: test-e2e
140140
test-e2e: ## Run end-to-end tests against an existing Kubernetes cluster. When using default configuration, the tests need at least 3 available GPUs.
141-
MANIFEST_PATH=$(PROJECT_DIR)/$(E2E_MANIFEST_PATH) go test ./test/e2e/epp/ -v -ginkgo.v
141+
MANIFEST_PATH=$(PROJECT_DIR)/$(E2E_MANIFEST_PATH) ./hack/run-e2es.sh
142142

143143
.PHONY: lint
144144
lint: golangci-lint ## Run golangci-lint linter

hack/run-e2es.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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

Comments
 (0)