Skip to content

Commit 37c63ed

Browse files
authored
Merge branch 'main' into staging/multi_board
2 parents 0c6e927 + cf104d3 commit 37c63ed

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/treadmill-ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
# For the available images see
104104
# https://book.treadmill.ci/treadmillci-deployment/images.html
105105
IMAGE_ID: 7222c531071705fcaaf2a82504c3d09c93701d8a307de266fb551294911a1181
106+
106107
# Limit the supervisors to hosts that are compatible with this
107108
# image. This is a hack until we introduce "image sets" which define
108109
# multiple images for various supervisor hosts, but otherwise behave
@@ -293,7 +294,7 @@ jobs:
293294
# Activate the virtual environment from the hwci directory
294295
source ./hwci/.venv/bin/activate
295296
296-
STEP_FAIL=0
297+
FAILED_TESTS=""
297298
298299
# Generate a summary of all the tests executed:
299300
cat <<GITHUB_STEP_SUMMARY >>"$GITHUB_STEP_SUMMARY"
@@ -306,6 +307,9 @@ jobs:
306307
while read TEST; do
307308
# WHILE ---------->
308309
310+
# Open a new "group" in the GitHub actions output for this test:
311+
echo "::group::Test ${TEST}"
312+
309313
# For markdown links, we want a sanitized test name without special characters
310314
SANITIZED_TEST_NAME="${TEST//[^[:alnum:]]/_}"
311315
@@ -429,7 +433,11 @@ jobs:
429433
else
430434
echo "===== Test $TEST failed! ====="
431435
echo "| ❌ | \`$TEST\` ([Output](#test-$SANITIZED_TEST_NAME)) |" >>"$GITHUB_STEP_SUMMARY"
432-
STEP_FAIL=1
436+
437+
# Append this test to the list of failed tests (prefixing
438+
# it with a comma, if other tests have already failed:
439+
test -n "${FAILED_TESTS}" && FAILED_TESTS="${FAILED_TESTS}, "
440+
FAILED_TESTS="${FAILED_TESTS}${TEST}"
433441
fi
434442
435443
# Sanitize the output (remove triple backslashes) and copy it into the step summary details:
@@ -443,6 +451,9 @@ jobs:
443451
444452
STEP_SUMMARY_DETAILS
445453
454+
# Close the "group" in the GitHub actions output:
455+
echo "::endgroup::"
456+
446457
# -----------> DONE
447458
done < <(echo "$JSON_TEST_ARRAY" | jq -r -c '.[]')
448459
@@ -451,8 +462,8 @@ jobs:
451462
cat "./step-summary-details.txt" >>"$GITHUB_STEP_SUMMARY"
452463
453464
# Exit with an error if at least one test failed:
454-
if [ "$STEP_FAIL" != "0" ]; then
455-
echo "At least one test failed, exiting with error."
465+
if [ "$FAILED_TESTS" != "" ]; then
466+
echo "One or more tests failed, exiting with error: $FAILED_TESTS"
456467
exit 1
457468
fi
458469
- name: Request shutdown after successful job completion

0 commit comments

Comments
 (0)