Skip to content

Commit c527221

Browse files
authored
ci/qa: Use failfast argument flag for tests (#900)
Avoid running all the tests if one is failing, since we'd likely need to trigger another test job. Thus avoid wasting resources
2 parents 424966b + 971eab6 commit c527221

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/qa.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ jobs:
249249
# Overriding the default coverage directory is not an exported flag of go test (yet), so
250250
# we need to override it using the test.gocoverdir flag instead.
251251
#TODO: Update when https://go-review.googlesource.com/c/go/+/456595 is merged.
252-
go test -json -timeout ${GO_TESTS_TIMEOUT} -cover -covermode=set ./... -coverpkg=./... -shuffle=on -args -test.gocoverdir="${raw_cov_dir}" | \
252+
go test -json -timeout ${GO_TESTS_TIMEOUT} -cover -covermode=set ./... -coverpkg=./... \
253+
-shuffle=on -failfast -args -test.gocoverdir="${raw_cov_dir}" | \
253254
gotestfmt --logfile "${AUTHD_TESTS_ARTIFACTS_PATH}/gotestfmt.cover.log"
254255
255256
# Convert the raw coverage data into textfmt so we can merge the Rust one into it
@@ -282,7 +283,7 @@ jobs:
282283
AUTHD_TESTS_SLEEP_MULTIPLIER: 3
283284
GORACE: log_path=${{ env.AUTHD_TESTS_ARTIFACTS_PATH }}/gorace.log
284285
run: |
285-
go test -json -timeout ${GO_TESTS_TIMEOUT} -race ./... | \
286+
go test -json -timeout ${GO_TESTS_TIMEOUT} -race -failfast ./... | \
286287
gotestfmt --logfile "${AUTHD_TESTS_ARTIFACTS_PATH}/gotestfmt.race.log"
287288
288289
- name: Run PAM tests (with Address Sanitizer)
@@ -300,7 +301,7 @@ jobs:
300301
# Print executed commands to ease debugging
301302
set -x
302303
303-
go test -C ./pam/internal -json -asan -gcflags=all="${GO_GC_FLAGS}" -timeout ${GO_TESTS_TIMEOUT} ./... | \
304+
go test -C ./pam/internal -json -asan -gcflags=all="${GO_GC_FLAGS}" -failfast -timeout ${GO_TESTS_TIMEOUT} ./... | \
304305
gotestfmt --logfile "${AUTHD_TESTS_ARTIFACTS_PATH}/gotestfmt.pam-internal-asan.log" || exit_code=$?
305306
if [ -n "${exit_code:-}" ]; then
306307
cat "${AUTHD_TESTS_ARTIFACTS_PATH}"/asan.log* || true
@@ -312,6 +313,7 @@ jobs:
312313
go test -asan -gcflags=all="${GO_GC_FLAGS}" -c
313314
go tool test2json -p pam/integrations-test ./integration-tests.test \
314315
-test.v=test2json \
316+
-test.failfast \
315317
-test.timeout ${GO_TESTS_TIMEOUT} | \
316318
gotestfmt --logfile "${AUTHD_TESTS_ARTIFACTS_PATH}/gotestfmt.pam-integration-tests-asan.log" || \
317319
exit_code=$?

0 commit comments

Comments
 (0)