Skip to content

Commit cd8134e

Browse files
committed
print test errors in CI
1 parent be119b8 commit cd8134e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

build.xml

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<formatter type="xml"/>
6161
</test>
6262
</junit>
63+
<exec executable="./print_test_errors.sh" failonerror="true">
64+
<arg value="."/>
65+
</exec>
6366
</target>
6467

6568
<target name="clean" description="clean up">

print_test_errors.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
#
3+
# Read junit test-reports and print a summary of the error-cases, including the stack trace.
4+
# Will exit with status 1 if there are any errors, otherwise exit status 0.
5+
#
6+
# By default will scan all files in "./test.reports".
7+
#
8+
# Usage "./print_test_errors.sh <test-report-path>
9+
#
10+
awk '/<(failure|error)/,/\/(failure|error)/ {print prev; has_err=1} {prev=$0} END {exit has_err}' ${1:-test.reports/*}

0 commit comments

Comments
 (0)