Skip to content

Commit

Permalink
print test errors in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Jul 29, 2020
1 parent be119b8 commit cd8134e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<formatter type="xml"/>
</test>
</junit>
<exec executable="./print_test_errors.sh" failonerror="true">
<arg value="."/>
</exec>
</target>

<target name="clean" description="clean up">
Expand Down
10 changes: 10 additions & 0 deletions print_test_errors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
#
# Read junit test-reports and print a summary of the error-cases, including the stack trace.
# Will exit with status 1 if there are any errors, otherwise exit status 0.
#
# By default will scan all files in "./test.reports".
#
# Usage "./print_test_errors.sh <test-report-path>
#
awk '/<(failure|error)/,/\/(failure|error)/ {print prev; has_err=1} {prev=$0} END {exit has_err}' ${1:-test.reports/*}

0 comments on commit cd8134e

Please sign in to comment.