From 11c55b7aecc1526ef3b400adecd37a166e2a4e6f Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 2 Feb 2024 10:32:40 +0530 Subject: [PATCH] ci: Print failed tests to Action Summary (#30853) This should show the failed test list in the GitHub actions summary so we don't have to load the _extremely large_ full log file of the server tests, just to see the list of tests that failed. --- .github/workflows/server-build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/server-build.yml b/.github/workflows/server-build.yml index e167513609..3abc74258c 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/server-build.yml @@ -181,7 +181,16 @@ jobs: args+=("-DfailIfNoTests=false" "-Dtest=${failed_tests}") fi args+=("-DtestResultFile=$PWD/failed-server-tests.txt") - mvn test "${args[@]}" + if ! mvn test "${args[@]}"; then + if [[ -s failed-server-tests.txt ]]; then + { + echo "## Failed tests" + echo + sed 's/^/- /' 'failed-server-tests.txt' + } >> "$GITHUB_STEP_SUMMARY" + fi + exit 1 + fi # Set status = failedtest - name: Set fail if there are test failures