File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,12 @@ mvn_command+=" clean compile test"
5353echo " DEBUG: Executing Maven command: ${mvn_command} "
5454${mvn_command} | tee build.log
5555
56- tests_run=$( cat build.log | grep " Tests run:" | tail -n 1 | sed ' s/.*Tests run: \([0-9]*\).*/\1/' )
56+ TEST_RESULTS=$( cat build.log | grep " Tests run:" | tail -n 1)
57+ tests_run=$( echo $TEST_RESULTS | sed ' s/.*Tests run: \([0-9]*\).*/\1/' )
58+ tests_failed=$( echo $TEST_RESULTS | sed ' s/.*Failures: \([0-9]*\).*/\1/' )
59+ tests_errors=$( echo $TEST_RESULTS | sed ' s/.*Errors: \([0-9]*\).*/\1/' )
5760
58- echo " DEBUG: tests_run = $tests_run "
61+ echo " DEBUG: tests_run = $tests_run tests_failed = $tests_failed tests_errors = $tests_errors "
5962
6063if [ -z " $tests_run " ]; then
6164 echo " WARNING: Could not determine the number of tests run."
@@ -67,4 +70,14 @@ if [ "$tests_run" -eq 0 ]; then
6770 exit 1
6871fi
6972
70- echo " INFO: $tests_run tests were run!"
73+ echo " INFO: $tests_run tests were run!"
74+
75+ if [ " $tests_failed " -ne 0 ]; then
76+ echo " ERROR: $tests_failed Tests Failed!"
77+ exit 1
78+ fi
79+
80+ if [ " $tests_errors " -ne 0 ]; then
81+ echo " ERROR: $tests_errors Tests had errors!"
82+ exit 1
83+ fi
You can’t perform that action at this time.
0 commit comments