ginkgo-e2e.sh: support arguments in KUBE_E2E_TEST_ARGS env variable

This is useful when invoked through kind's e2e-k8s.sh which doesn't support
passing through arguments.

The alternatives are:
- Extending e2e-k8s.sh to support passing through arguments.
- Bespoke copies of e2e-k8s.sh which set additional arguments.

Both seem more complex than allowing simple arguments to be passed through the
env variable.
This commit is contained in:
Patrick Ohly 2025-12-05 10:59:28 +01:00
parent 1c24a05ce1
commit 68fec4eec0

View file

@ -213,6 +213,13 @@ fi
# is not used.
suite_args+=(--report-complete-ginkgo --report-complete-junit)
# Additional e2e.test arguments. Split into individual arguments at spaces.
# For more complex arguments pass additional arguments to the script.
if [[ -n "${KUBE_E2E_TEST_ARGS:-}" ]]; then
# shellcheck disable=SC2206 # Splitting at word boundaries is intentional here.
suite_args+=(${KUBE_E2E_TEST_ARGS})
fi
# When SIGTERM doesn't reach the E2E test suite binaries, ginkgo will exit
# without collecting information from about the currently running and
# potentially stuck tests. This seems to happen when Prow shuts down a test