Commit Graph

4 Commits

Author SHA1 Message Date
Todd Zullinger
0af3adfcb1 include test-results & "trash" directory contents in build output
When a build fails, the contents of t/test-results and the trash
directories can be quite useful for debugging.  This is particularly
true when the failures occur only in Koji, where we can't get a shell
and poke around.

Create a compressed tarball and encode it with base64 to allow it to be
output along with the normal build output.  Include instruction on how
to extract the base64-encoded content from the build log inline.

The tar archive is compressed with zstd which provides a good balance of
speed and size.  The compression level of 17 was chosen after a number
of tests against real test failures, as opposed to entirely random
selection. ;)
2022-12-06 01:54:30 -05:00
Todd Zullinger
a245ca5676 print-failed-test-output: minor improvements
Drop the subshell used to create the string of dashes (and rename the
variable to "sep" at the same time).  Replace $(cat file) with the
equivalent but faster $(< file).
2019-02-11 22:47:30 -05:00
Todd Zullinger
676f6fab11 Improve debug output when 'make test' fails
If 'make test' fails before running any tests, the debug output from
print-failed-test-output is confusing:

    + ./print-failed-test-output
    cat: t/test-results/*.exit: No such file or directory
    ./print-failed-test-output: line 6: [: : integer expression expected

    --------------------------------------------------------------------------------
    t/test-results/*.out
    --------------------------------------------------------------------------------
    cat: t/test-results/*.out: No such file or directory

Use the bash failglob option to imrpve the output:

    + ./print-failed-test-output
    ./print-failed-test-output: line 12: no match: t/test-results/*.exit
2018-05-25 10:20:48 -04:00
Todd Zullinger
2e7d4595e5 Include verbose logs in build output for 'make test' failures
When building in koji or copr and a test fails, the verbose output from
the tests can be very useful in determining the cause.  Print the output
from failing tests, borrowing heavily from the upstream code¹ used when
running tests in Travis CI².

This could be done inline in %check rather than in a separate script.
The downside is that rpm would include each command invocation of the
loop in the output, which adds a lot of useless text to the already
copious build output.

¹ https://git.kernel.org/pub/scm/git/git.git/plain/ci/print-test-failures.sh
² https://travis-ci.org/git/git
2017-12-21 18:36:31 -05:00