From 467ceb15aab4aa9220ef8b00a34141045329b5ff Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 21 May 2021 05:30:00 -0600 Subject: [PATCH] Base/CI: Create and check test-results.log file for on-target tests Change run-tests-and-shutdown.sh to output a dead simple results file that just records how many tests failed. In the CI script, mount the _disk_image after running tests and verify that the number of failed tests is 0. Otherwise, fail the build :^) While we're here, bump the timeout for the tests up to 30 minutes, to make sure that less powerful runners don't fail the job unecessarily. --- .github/workflows/cmake.yml | 13 ++++++++++++- Base/home/anon/tests/run-tests-and-shutdown.sh | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7915109119..b52a24378b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -152,7 +152,18 @@ jobs: echo "::group::ninja run # Qemu output" ninja run echo "::endgroup::" - timeout-minutes: 20 + echo "::group::Verify Output File" + mkdir fsmount + sudo mount -t ext2 -o loop,rw _disk_image fsmount + echo "Results: " + sudo cat fsmount/home/anon/test-results.log + if ! sudo grep -q "Failed: 0" fsmount/home/anon/test-results.log + then + echo "::error :^( Tests failed, failing job" + exit 1 + fi + echo "::endgroup::" + timeout-minutes: 30 - name: Print Target Logs # Extremely useful if Serenity hangs trying to run one of the tests diff --git a/Base/home/anon/tests/run-tests-and-shutdown.sh b/Base/home/anon/tests/run-tests-and-shutdown.sh index 0abd0a86f6..9bbcf00b1a 100755 --- a/Base/home/anon/tests/run-tests-and-shutdown.sh +++ b/Base/home/anon/tests/run-tests-and-shutdown.sh @@ -47,6 +47,8 @@ if test $fail_count -gt 0 { echo "==== Failing tests: $failed_tests ====" } +echo "Failed: $fail_count" > ./test-results.log + if test $DO_SHUTDOWN_AFTER_TESTS { shutdown -n }