ci(build): list failed tests on the run page (#28783)

* ci(build): list failed tests on the run page
* ci(build): keep spaces in the names of listed failed tests
This commit is contained in:
NobleBrains authored and GitHub committed 2026-12-04 12:03:09 +13:00
1 parent c1601e56d5
commit 790e17621f
1 file changed
+39
+39
View File
@@ -357,6 +357,19 @@ jobs:
repeat=until-pass:2
if [ "$RUNNER_OS" = Windows ]; then repeat=until-pass:3; fi
ctest --test-dir build-relinker --output-on-failure --timeout 120 --parallel 4 --no-tests=error --repeat "$repeat" --output-log ctest.log
- name: List failed tests
if: ${{ failure() }}
shell: bash
run: |
[ -f ctest.log ] || exit 0
awk '{ sub(/\r$/, "") }
/^The following tests FAILED:/ { listing = 1; next }
listing && /^[ \t]+[0-9]+ - / { name = $0; sub(/^[ \t]+[0-9]+ - /, "", name); sub(/\)[^)]*$/, "", name)
match(name, /.* \(/); why = substr(name, RLENGTH + 1); name = substr(name, 1, RLENGTH - 2)
if (!count++) printf "### Failed tests on %s\n\n", ENVIRON["RUNNER_OS"] >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "- `%s` (%s)\n", name, why >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "::error title=Failed test::%s (%s) on %s\n", name, why, ENVIRON["RUNNER_OS"]; next }
{ listing = 0 }' ctest.log
- name: Report slow and flaky tests
if: ${{ !cancelled() }}
run: |
@@ -756,6 +769,19 @@ jobs:
- name: Report compiler cache statistics
if: ${{ !cancelled() }}
run: ccache --show-stats
- name: List failed tests
if: ${{ failure() }}
shell: bash
run: |
[ -f ctest.log ] || exit 0
awk '{ sub(/\r$/, "") }
/^The following tests FAILED:/ { listing = 1; next }
listing && /^[ \t]+[0-9]+ - / { name = $0; sub(/^[ \t]+[0-9]+ - /, "", name); sub(/\)[^)]*$/, "", name)
match(name, /.* \(/); why = substr(name, RLENGTH + 1); name = substr(name, 1, RLENGTH - 2)
if (!count++) printf "### Failed tests on %s\n\n", ENVIRON["RUNNER_OS"] >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "- `%s` (%s)\n", name, why >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "::error title=Failed test::%s (%s) on %s\n", name, why, ENVIRON["RUNNER_OS"]; next }
{ listing = 0 }' ctest.log
- name: Report tests slower than 30 s
if: ${{ !cancelled() }}
shell: bash
@@ -1015,6 +1041,19 @@ jobs:
- name: Report compiler cache statistics
if: ${{ !cancelled() }}
run: ccache --show-stats
- name: List failed tests
if: ${{ failure() }}
shell: bash
run: |
[ -f ctest.log ] || exit 0
awk '{ sub(/\r$/, "") }
/^The following tests FAILED:/ { listing = 1; next }
listing && /^[ \t]+[0-9]+ - / { name = $0; sub(/^[ \t]+[0-9]+ - /, "", name); sub(/\)[^)]*$/, "", name)
match(name, /.* \(/); why = substr(name, RLENGTH + 1); name = substr(name, 1, RLENGTH - 2)
if (!count++) printf "### Failed tests on %s\n\n", ENVIRON["RUNNER_OS"] >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "- `%s` (%s)\n", name, why >> ENVIRON["GITHUB_STEP_SUMMARY"]
printf "::error title=Failed test::%s (%s) on %s\n", name, why, ENVIRON["RUNNER_OS"]; next }
{ listing = 0 }' ctest.log
- name: Report slow and flaky tests
if: ${{ !cancelled() }}
shell: bash