File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ declare -A UT_TARGET_GROUPS=(
2222# Markdown table header
2323echo -e " Status\tPassed\tFailed\tSkipped\tTotal\tGroup\tDuration(s)" >> " ${SUMMARY_FILE} "
2424
25+ # Track if any test failed
26+ any_failed=0
27+
2528for group in " ${! UT_TARGET_GROUPS[@]} " ; do
2629 targets=" ${UT_TARGET_GROUPS[$group]} "
2730 command=" bazel test --config=" ${CONFIG} " ${targets} "
@@ -44,13 +47,20 @@ for group in "${!UT_TARGET_GROUPS[@]}"; do
4447 status_symbol=" ✅"
4548 else
4649 status_symbol=" ❌"
50+ any_failed=1
4751 fi
4852
4953 # Append as a markdown table row
50- echo -e " ${status_symbol} \t${tests_passed} \t${tests_failed} \t${tests_skipped} \t${tests_executed} \t${group} \t${duration} s" >> " ${SUMMARY_FILE} "
54+ echo -e " ${status_symbol} \t${tests_passed} \t${tests_failed} \t${tests_skipped} \t${tests_executed} \t${group} \t${duration} s" | tee -a " ${SUMMARY_FILE} "
5155 echo " ==========================================="
5256 echo -e " \n\n"
5357done
5458
5559# Align the summary table columns
5660column -t -s $' \t ' " ${SUMMARY_FILE} " > " ${SUMMARY_FILE} .tmp" && mv " ${SUMMARY_FILE} .tmp" " ${SUMMARY_FILE} "
61+
62+ # Final check: exit with non-zero if any test failed
63+ if [[ $any_failed -ne 0 ]]; then
64+ echo " Some unit test groups failed. Exiting with non-zero status."
65+ exit 1
66+ fi
You can’t perform that action at this time.
0 commit comments