Skip to content

Commit 8621326

Browse files
author
k8s-merge-robot
authored
Merge pull request kubernetes#28191 from lavalamp/red-dot-city
Automatic merge from submit-queue unstable -> failed @fejta and @ixdy
2 parents 331fde8 + b754695 commit 8621326

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

hack/jenkins/e2e-runner.sh

+12-3
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,18 @@ function e2e_test() {
192192
echo "Publish version to ci/latest-green.txt: $(cat version)"
193193
gsutil cp ./version gs://kubernetes-release/ci/latest-green.txt
194194
fi
195+
return ${exitcode}
195196
}
196197

197198
echo "--------------------------------------------------------------------------------"
198199
echo "Test Environment:"
199200
printenv | sort
200201
echo "--------------------------------------------------------------------------------"
201202

203+
# Set this var instead of exiting-- we must do the cluster teardown step. We'll
204+
# return this at the very end.
205+
EXIT_CODE=0
206+
202207
# We get the Kubernetes tarballs unless we are going to use old ones
203208
if [[ "${JENKINS_USE_EXISTING_BINARIES:-}" =~ ^[yY]$ ]]; then
204209
echo "Using existing binaries; not cleaning, fetching, or unpacking new ones."
@@ -329,7 +334,7 @@ if [[ -n "${JENKINS_PUBLISHED_SKEW_VERSION:-}" ]]; then
329334
if [[ "${E2E_UPGRADE_TEST:-}" == "true" ]]; then
330335
# Add a report prefix for the e2e tests so that the tests don't get overwritten when we run
331336
# the rest of the e2es.
332-
E2E_REPORT_PREFIX='upgrade' e2e_test "${GINKGO_UPGRADE_TEST_ARGS:-}"
337+
E2E_REPORT_PREFIX='upgrade' e2e_test "${GINKGO_UPGRADE_TEST_ARGS:-}" || EXIT_CODE=1
333338
fi
334339
if [[ "${JENKINS_USE_SKEW_TESTS:-}" != "true" ]]; then
335340
# Back out into the old tests now that we've downloaded & maybe upgraded.
@@ -344,7 +349,7 @@ if [[ -n "${JENKINS_PUBLISHED_SKEW_VERSION:-}" ]]; then
344349
fi
345350

346351
if [[ "${E2E_TEST,,}" == "true" ]]; then
347-
e2e_test "${GINKGO_TEST_ARGS:-}"
352+
e2e_test "${GINKGO_TEST_ARGS:-}" || EXIT_CODE=1
348353
fi
349354

350355
### Start Kubemark ###
@@ -362,6 +367,8 @@ if [[ "${USE_KUBEMARK:-}" == "true" ]]; then
362367
# junit.xml results for test failures and not process the exit code. This is needed by jenkins to more gracefully
363368
# handle blocking the merge queue as a result of test failure flakes. Infrastructure failures should continue to
364369
# exit non-0.
370+
# TODO: The above comment is no longer accurate. Need to fix this before
371+
# turning xunit off for the postsubmit tests. See: #28200
365372
./test/kubemark/run-e2e-tests.sh --ginkgo.focus="${KUBEMARK_TESTS:-starting\s30\spods}" "${KUBEMARK_TEST_ARGS:-}" || dump_cluster_logs
366373
./test/kubemark/stop-kubemark.sh
367374
NUM_NODES=${NUM_NODES_BKP}
@@ -394,6 +401,8 @@ if [[ "${E2E_UP:-}" == "${E2E_DOWN:-}" && -f "${gcp_resources_before}" && -f "${
394401
if [[ -n $(echo "${difference}" | tail -n +3 | grep -E "^\+") ]] && [[ "${FAIL_ON_GCP_RESOURCE_LEAK:-}" == "true" ]]; then
395402
echo "${difference}"
396403
echo "!!! FAIL: Google Cloud Platform resources leaked while running tests!"
397-
exit 1
404+
EXIT_CODE=1
398405
fi
399406
fi
407+
408+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)