Преглед изворни кода

Merge pull request #46060 from vvoland/integration-no-fail-fast

ci/integration: Don't fail fast
Sebastiaan van Stijn пре 1 година
родитељ
комит
d4d645d32a
2 измењених фајлова са 11 додато и 1 уклоњено
  1. 1 0
      Makefile
  2. 10 1
      hack/make/.integration-test-helpers

+ 1 - 0
Makefile

@@ -57,6 +57,7 @@ DOCKER_ENVS := \
 	-e TEST_FORCE_VALIDATE \
 	-e TEST_FORCE_VALIDATE \
 	-e TEST_INTEGRATION_DIR \
 	-e TEST_INTEGRATION_DIR \
 	-e TEST_INTEGRATION_USE_SNAPSHOTTER \
 	-e TEST_INTEGRATION_USE_SNAPSHOTTER \
+	-e TEST_INTEGRATION_FAIL_FAST \
 	-e TEST_SKIP_INTEGRATION \
 	-e TEST_SKIP_INTEGRATION \
 	-e TEST_SKIP_INTEGRATION_CLI \
 	-e TEST_SKIP_INTEGRATION_CLI \
 	-e TESTCOVERAGE \
 	-e TESTCOVERAGE \

+ 10 - 1
hack/make/.integration-test-helpers

@@ -66,6 +66,7 @@ run_test_integration() {
 run_test_integration_suites() {
 run_test_integration_suites() {
 	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
 	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
 	local dirs="$1"
 	local dirs="$1"
+	local failed=0
 	for dir in ${dirs}; do
 	for dir in ${dirs}; do
 		if ! (
 		if ! (
 			cd "$dir"
 			cd "$dir"
@@ -96,8 +97,16 @@ run_test_integration_suites() {
 				--junitfile="${ABS_DEST}/${pkgname//./-}-junit-report.xml" \
 				--junitfile="${ABS_DEST}/${pkgname//./-}-junit-report.xml" \
 				--raw-command \
 				--raw-command \
 				-- go tool test2json -p "${pkgname}" -t ./test.main ${pkgtestflags}
 				-- go tool test2json -p "${pkgname}" -t ./test.main ${pkgtestflags}
-		); then exit 1; fi
+		); then
+			if [ -n "${TEST_INTEGRATION_FAIL_FAST}" ]; then
+				exit 1
+			fi
+			failed=1
+		fi
 	done
 	done
+	if [ $failed -eq 1 ]; then
+		exit 1
+	fi
 }
 }
 
 
 build_test_suite_binaries() {
 build_test_suite_binaries() {