ci: make it easier to find failed tests' logs in the GitHub workflow
commit08dccc8fc1f248c8de7e87ac6e435edac4f77ebe
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 21 May 2022 22:18:49 +0000 (21 22:18 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 May 2022 23:25:56 +0000 (21 16:25 -0700)
tree57cdd1713f63f8351d80fbfe487646f7497a0674
parentb95181cf822bde2c807127abd502683822d86cf8
ci: make it easier to find failed tests' logs in the GitHub workflow

When investigating a test failure, the time that matters most is the
time it takes from getting aware of the failure to displaying the output
of the failing test case.

You currently have to know a lot of implementation details when
investigating test failures in the CI runs. The first step is easy: the
failed job is marked quite clearly, but when opening it, the failed step
is expanded, which in our case is the one running
`ci/run-build-and-tests.sh`. This step, most notably, only offers a
high-level view of what went wrong: it prints the output of `prove`
which merely tells the reader which test script failed.

The actually interesting part is in the detailed log of said failed
test script. But that log is shown in the CI run's step that runs
`ci/print-test-failures.sh`. And that step is _not_ expanded in the web
UI by default. It is even marked as "successful", which makes it very
easy to miss that there is useful information hidden in there.

Let's help the reader by showing the failed tests' detailed logs in the
step that is expanded automatically, i.e. directly after the test suite
failed.

This also helps the situation where the _build_ failed and the
`print-test-failures` step was executed under the assumption that the
_test suite_ failed, and consequently failed to find any failed tests.

An alternative way to implement this patch would be to source
`ci/print-test-failures.sh` in the `handle_test_failures` function to
show these logs. However, over the course of the next few commits, we
want to introduce some grouping which would be harder to achieve that
way (for example, we do want a leaner, and colored, preamble for each
failed test script, and it would be trickier to accommodate the lack of
nested groupings in GitHub workflows' output).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml
ci/lib.sh
ci/run-build-and-tests.sh
ci/run-test-slice.sh