Skip to content

Commit 677c707

Browse files
szedergitster
authored andcommitted
travis-ci: only print test failures if there are test results available
When a build job running the test suite fails, our 'ci/print-test-failures.sh' script scans all 't/test-results/*.exit' files to find failed tests and prints their verbose output. However, if a build job were to fail before it ever gets to run the test suite, then there will be no files to match the above pattern and the shell will take the pattern literally, resulting in errors like this in the trace log: cat: t/test-results/*.exit: No such file or directory ------------------------------------------------------------------------ t/test-results/*.out... ------------------------------------------------------------------------ cat: t/test-results/*.out: No such file or directory Check upfront and proceed only if there are any such files present. Signed-off-by: SZEDER Gábor <[email protected]> Reviewed-by: Lars Schneider <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e72cfc commit 677c707

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ci/print-test-failures.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
# Tracing executed commands would produce too much noise in the loop below.
99
set +x
1010

11+
if ! ls t/test-results/*.exit >/dev/null 2>/dev/null
12+
then
13+
echo "Build job failed before the tests could have been run"
14+
exit
15+
fi
16+
1117
for TEST_EXIT in t/test-results/*.exit
1218
do
1319
if [ "$(cat "$TEST_EXIT")" != "0" ]

0 commit comments

Comments
 (0)