Skip to content

Commit b8d781f

Browse files
committed
Make test output collapsible
To make the test logs more pleasant to interact with, this makes the test output of failed test cases collapsible. This avoids cluttering the test overview with the typically very long output of the individual test cases, such that users can get a full overview of all tests by default. If needed, the output of a specific test can easily be expanded in the GitHub Actions user interface. As the GitHub Actions user interface already indents the content of groups, we no longer need to indent it with sed.
1 parent cd3cbbb commit b8d781f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/testlib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,14 @@ begin_test () {
150150
}
151151

152152
report_failure_output () {
153+
echo "::group::Output of failed test" 1>&2
153154
# Truncate the test output to exclude testing-related instructions
154155
echo "$(<"$TRASHDIR/out")" \
155156
| sed '0,/begin_test_truncate_marker/d' \
156157
| sed -n '/end_test_truncate_marker/q;p' | head -n -2 \
157-
| sed 's/^/ /' \
158158
1>&2
159159
echo -e "\nTest failed. The last command exited with exit code $test_status." 1>&2
160+
echo "::endgroup::" 1>&2
160161
}
161162

162163
# Mark the end of a test.

0 commit comments

Comments
 (0)