From 4590ac57e2c1ba20c21c9fe77f5e6fe3042e01b6 Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Fri, 11 Dec 2020 16:24:15 +0100 Subject: [PATCH] tests/e2e: allow overriding helper image tag for e2e tests to avoid building --- Makefile | 3 ++- tests/dind.sh | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1a5f72f1..222d8fd8 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,7 @@ E2E_LOG_LEVEL ?= WARN E2E_SKIP ?= E2E_EXTRA ?= E2E_RUNNER_START_TIMEOUT ?= 10 +E2E_HELPER_IMAGE_TAG ?= ########## Go Build Options ########## # Build targets @@ -168,7 +169,7 @@ test: e2e: build-docker-dind @echo "Running e2e tests in k3d:$(K3D_IMAGE_TAG)" - LOG_LEVEL="$(E2E_LOG_LEVEL)" E2E_SKIP="$(E2E_SKIP)" E2E_EXTRA="$(E2E_EXTRA)" E2E_RUNNER_START_TIMEOUT=$(E2E_RUNNER_START_TIMEOUT) tests/dind.sh "${K3D_IMAGE_TAG}-dind" + LOG_LEVEL="$(E2E_LOG_LEVEL)" E2E_SKIP="$(E2E_SKIP)" E2E_EXTRA="$(E2E_EXTRA)" E2E_RUNNER_START_TIMEOUT=$(E2E_RUNNER_START_TIMEOUT) E2E_HELPER_IMAGE_TAG="$(E2E_HELPER_IMAGE_TAG)" tests/dind.sh "${K3D_IMAGE_TAG}-dind" ci-tests: fmt check e2e diff --git a/tests/dind.sh b/tests/dind.sh index 2a9a7f4d..fdce3f24 100755 --- a/tests/dind.sh +++ b/tests/dind.sh @@ -46,7 +46,13 @@ until docker inspect "$k3de2e" | jq ".[0].State.Running" && docker logs "$k3de2e done # build helper container images -docker exec --workdir /src "$k3de2e" make build-helper-images +if [ -z "$E2E_HELPER_IMAGE_TAG" ]; then + docker exec --workdir /src "$k3de2e" make build-helper-images + # execute tests + docker exec "$k3de2e" /src/tests/runner.sh +else + # execute tests + docker exec -e "K3D_HELPER_IMAGE_TAG=$E2E_HELPER_IMAGE_TAG" "$k3de2e" /src/tests/runner.sh +fi + -# execute tests -docker exec "$k3de2e" /src/tests/runner.sh