Skip to content

Commit 9e59890

Browse files
committed
test: consolidate and rename e2e runner scripts
Signed-off-by: roytman <roytman@il.ibm.com>
1 parent 48b7dff commit 9e59890

6 files changed

Lines changed: 77 additions & 57 deletions

File tree

.github/workflows/ci-pr-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,4 @@ jobs:
450450
E2E_LABEL_FILTER: ${{ matrix.suite.label-filter }}
451451
LOAD_VLLM_RENDER_IMAGE: ${{ matrix.suite.needs-renderer }}
452452
PULL_VLLM_RENDER_IMAGE: "false"
453-
run: make test-e2e-scheduler-run
453+
run: make test-e2e-router-run

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,24 +304,24 @@ test-e2e-gaie-run: image-pull ## Ensure images are present, then run GAIE e2e te
304304
$(CONTAINER_RUNTIME) run $(BUILDER_RUN_FLAGS) $(BUILDER_E2E_FLAGS) \
305305
-e EPP_IMAGE=$(GAIE_E2E_IMAGE) \
306306
-e USE_KIND=true \
307-
$(BUILDER_IMAGE) ./hack/test-e2e.sh
307+
$(BUILDER_IMAGE) ./test/scripts/test-e2e-gaie.sh
308308

309309
.PHONY: test-e2e-gaie
310310
test-e2e-gaie: image-build-builder image-build ## Build images and run GAIE e2e tests
311311
$(MAKE) test-e2e-gaie-run
312312

313-
.PHONY: test-e2e-scheduler-run
314-
test-e2e-scheduler-run: image-pull ## Ensure images are present, then run scheduler e2e tests
313+
.PHONY: test-e2e-router-run
314+
test-e2e-router-run: image-pull ## Ensure images are present, then run router e2e tests
315315
@printf "\033[33;1m==== Running End to End Tests ====\033[0m\n"
316316
$(CONTAINER_RUNTIME) run $(BUILDER_RUN_FLAGS) $(BUILDER_E2E_FLAGS) \
317-
$(BUILDER_IMAGE) ./test/scripts/run_e2e.sh
317+
$(BUILDER_IMAGE) ./test/scripts/test-e2e-router.sh
318318

319-
.PHONY: test-e2e-scheduler
320-
test-e2e-scheduler: image-build-builder image-build ## Build images and run scheduler e2e tests
321-
$(MAKE) test-e2e-scheduler-run
319+
.PHONY: test-e2e-router
320+
test-e2e-router: image-build-builder image-build ## Build images and run router e2e tests
321+
$(MAKE) test-e2e-router-run
322322

323323
.PHONY: test-e2e
324-
test-e2e: test-e2e-gaie test-e2e-scheduler ## Run all end-to-end tests sequentially
324+
test-e2e: test-e2e-gaie test-e2e-router ## Run all end-to-end tests sequentially
325325

326326

327327
.PHONY: bench-tokenizer

test/scripts/e2e-common.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2025 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Shared helpers for the e2e runner scripts. Source, do not execute.
16+
17+
# e2e_handle_interrupt deletes the named kind cluster on Ctrl-C and exits 130.
18+
# An empty cluster name means there is nothing to delete (the caller did not
19+
# create a cluster it owns). E2E_KEEP_CLUSTER_ON_FAILURE=true keeps the cluster.
20+
e2e_handle_interrupt() {
21+
local cluster="$1"
22+
echo "Interrupted!"
23+
if [ -n "${cluster}" ] && [ "${E2E_KEEP_CLUSTER_ON_FAILURE:-false}" != "true" ]; then
24+
echo "Deleting kind cluster '${cluster}'"
25+
kind delete cluster --name "${cluster}" 2>/dev/null || true
26+
elif [ -n "${cluster}" ]; then
27+
echo "Keeping kind cluster '${cluster}' (E2E_KEEP_CLUSTER_ON_FAILURE=true)"
28+
fi
29+
exit 130 # SIGINT (Ctrl+C)
30+
}
31+
32+
# run_ginkgo_suite runs the Ginkgo e2e suite in the given package directory,
33+
# applying E2E_LABEL_FILTER when set.
34+
run_ginkgo_suite() {
35+
local pkg="$1"
36+
if [ -n "${E2E_LABEL_FILTER:-}" ]; then
37+
echo "Label filter: ${E2E_LABEL_FILTER}"
38+
go test -v -timeout 45m "${pkg}" -ginkgo.v -ginkgo.fail-fast "-ginkgo.label-filter=${E2E_LABEL_FILTER}"
39+
else
40+
go test -v -timeout 45m "${pkg}" -ginkgo.v -ginkgo.fail-fast
41+
fi
42+
}

test/scripts/run_e2e.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ set -euox pipefail
1818

1919
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2020

21+
# shellcheck source=test/scripts/e2e-common.sh
22+
source "${DIR}/e2e-common.sh"
23+
2124
EPP_IMAGE="${EPP_IMAGE:-ghcr.io/llm-d/llm-d-router-endpoint-picker:dev}"
2225
SIM_IMAGE="${VLLM_IMAGE:-ghcr.io/llm-d/llm-d-inference-sim:v0.9.2}"
23-
MANIFEST_PATH="${MANIFEST_PATH:-${DIR}/../test/testdata/sim-deployment.yaml}"
26+
MANIFEST_PATH="${MANIFEST_PATH:-${DIR}/../testdata/sim-deployment.yaml}"
2427
USE_KIND="${USE_KIND:-true}"
2528
KIND_NODE_IMAGE="${KIND_NODE_IMAGE:-mirror.gcr.io/kindest/node:v1.32.2}"
2629

@@ -48,18 +51,11 @@ load_images() {
4851
CLUSTER_NAME="${cluster}" ./scripts/load_image.sh "${EPP_IMAGE}" "${SIM_IMAGE}"
4952
}
5053

51-
cleanup() {
52-
echo "Interrupted!"
53-
if [ -n "${CREATED_CLUSTER}" ] && [ "${E2E_KEEP_CLUSTER_ON_FAILURE:-false}" != "true" ]; then
54-
echo "Deleting kind cluster '${CREATED_CLUSTER}'"
55-
kind delete cluster --name "${CREATED_CLUSTER}" 2>/dev/null || true
56-
fi
57-
exit 130 # SIGINT (Ctrl+C)
58-
}
59-
6054
# Normally kind cluster cleanup is done by AfterSuite; this trap only fires on
6155
# interruption signals so that a Ctrl+C still cleans up the cluster we created.
62-
trap cleanup INT TERM
56+
# CREATED_CLUSTER is empty until we create a cluster ourselves, so an interrupt
57+
# before then deletes nothing.
58+
trap 'e2e_handle_interrupt "${CREATED_CLUSTER}"' INT TERM
6359

6460
if [ "${USE_KIND}" = "true" ]; then
6561
install_kind
@@ -92,11 +88,5 @@ else
9288
fi
9389

9490
echo "Running Go e2e tests in ./test/e2e/epp/..."
95-
if [ -n "${E2E_LABEL_FILTER:-}" ]; then
96-
echo "Label filter: ${E2E_LABEL_FILTER}"
97-
MANIFEST_PATH="${MANIFEST_PATH}" E2E_IMAGE="${EPP_IMAGE}" \
98-
go test "${DIR}/../test/e2e/epp/" -v -timeout 45m -ginkgo.v -ginkgo.fail-fast "-ginkgo.label-filter=${E2E_LABEL_FILTER}"
99-
else
100-
MANIFEST_PATH="${MANIFEST_PATH}" E2E_IMAGE="${EPP_IMAGE}" \
101-
go test "${DIR}/../test/e2e/epp/" -v -timeout 45m -ginkgo.v -ginkgo.fail-fast
102-
fi
91+
export MANIFEST_PATH E2E_IMAGE="${EPP_IMAGE}"
92+
run_ginkgo_suite "${DIR}/../e2e/epp/"

test/scripts/test-e2e-router.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
7+
# shellcheck source=test/scripts/e2e-common.sh
8+
source "${DIR}/e2e-common.sh"
9+
10+
# Set trap only for interruption signals.
11+
# Normally kind cluster cleanup is done by AfterSuite; this suite always owns its
12+
# kind cluster, so an interrupt deletes it.
13+
trap 'e2e_handle_interrupt "e2e-tests"' INT TERM
14+
15+
echo "Running end to end tests"
16+
17+
run_ginkgo_suite "${DIR}/../e2e/"

0 commit comments

Comments
 (0)