From 5bfdd3c0c681635d48ca6c45a443a3dde5e2861f Mon Sep 17 00:00:00 2001 From: irbekrm Date: Wed, 27 Apr 2022 18:32:51 +0100 Subject: [PATCH] Always save e2e test logs Signed-off-by: irbekrm --- make/e2e-setup.mk | 2 +- make/e2e.sh | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/make/e2e-setup.mk b/make/e2e-setup.mk index 1ef9f359c..eb3150af7 100644 --- a/make/e2e-setup.mk +++ b/make/e2e-setup.mk @@ -415,7 +415,7 @@ e2e-setup-traefik: load-$(call image-tar,traefik) make/config/traefik/traefik-va e2e-setup-vault: load-$(call image-tar,vaultretagged) bin/scratch/kind-exists bin/tools/helm # Exported because it needs to flow down to make/e2e.sh. -export ARTIFACTS ?= bin/artifacts +export ARTIFACTS ?= $(shell pwd)/bin/artifacts .PHONY: kind-logs kind-logs: bin/scratch/kind-exists bin/tools/kind diff --git a/make/e2e.sh b/make/e2e.sh index 2dd511117..bdb5243a0 100755 --- a/make/e2e.sh +++ b/make/e2e.sh @@ -21,6 +21,8 @@ source "$here/config/lib.sh" cd "$here/.." || exit 1 set -e +ARTIFACTS=${ARTIFACTS:-$(pwd)/bin/artifacts} + # Why do we only run 20 tests concurrently? Because we have noticed that # many tests start timing out when the Prow pod gets overloaded. We are # using a n1-standard-8 VM (7900m vCPU and 24GB RAM), and the pod requests @@ -70,7 +72,6 @@ flake_attempts=1 ginkgo_skip= ginkgo_focus= feature_gates=AdditionalCertificateOutputFormats=true,ExperimentalCertificateSigningRequestControllers=true,ExperimentalGatewayAPISupport=true -artifacts= help() { cat </dev/null && [ -n "${!v}" ]; then eval "$(tr '[:upper:]' '[:lower:]' <<<"$v")=\"${!v}\"" fi @@ -171,11 +172,6 @@ ginkgo_args=("$@") if [[ -n "$ginkgo_focus" ]]; then ginkgo_args+=(--ginkgo.focus="${ginkgo_focus}"); fi if [[ -n "$ginkgo_skip" ]]; then ginkgo_args+=(--ginkgo.skip="${ginkgo_skip}"); fi -# Only enable junit output if ARTIFACTS is set. -if [[ -n "$artifacts" ]]; then - mkdir -p "$artifacts" - ginkgo_args+=(--report-dir="$artifacts") -fi # Ginkgo doesn't stream the logs when running in parallel (--nodes). Let's # disable parallelism to force Ginkgo to stream the logs when @@ -186,6 +182,8 @@ if [[ "${ginkgo_args[*]}" =~ ginkgo.focus ]]; then ginkgo_args+=(--ginkgo.v --test.v) fi +mkdir -p "${ARTIFACTS}" + # The command "kubectl cluster-info dump" returns 141 since grep breaks the # pipe as soon as it finds a match. service_ip_prefix=$(set +o pipefail && kubectl cluster-info dump | grep -m1 ip-range | cut -d= -f2 | cut -d. -f1,2,3) @@ -198,6 +196,7 @@ trace ginkgo \ ./test/e2e/ \ -- \ --repo-root="$PWD" \ + --report-dir="${ARTIFACTS}" \ --acme-dns-server="${service_ip_prefix}.16" \ --acme-ingress-ip="${service_ip_prefix}.15" \ --acme-gateway-ip="${service_ip_prefix}.14" \