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.
This commit is contained in:
Andrew Kaster 2021-05-21 05:30:00 -06:00 committed by Linus Groh
parent b86d597938
commit 467ceb15aa
2 changed files with 14 additions and 1 deletions

View file

@ -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

View file

@ -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
}