File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 5151 - name : Check Test Results
5252 run : |
5353 if [ -f "_test_results.log" ]; then
54- FAILURES=$(grep -c "\\[FAIL\\]" _test_results.log || echo "0")
55- PASSED=$(grep -c "\\[PASS\\]" _test_results.log || echo "0")
54+ # Use safer numeric handling with explicit defaults
55+ FAILURES=$(grep -c "\\[FAIL\\]" _test_results.log || true)
56+ FAILURES=${FAILURES:-0}
57+
58+ PASSED=$(grep -c "\\[PASS\\]" _test_results.log || true)
59+ PASSED=${PASSED:-0}
60+
61+ # Calculate total ensuring numeric values
5662 TOTAL=$((FAILURES + PASSED))
5763
5864 echo "::group::Complete Test Results"
6470 if [ "$FAILURES" -gt 0 ]; then
6571 echo "::error::$FAILURES test(s) failed!"
6672 echo "Failed tests:"
67- grep "\\[FAIL\\]" _test_results.log
73+ grep "\\[FAIL\\]" _test_results.log || true
6874 exit 1
6975 else
7076 echo "::notice::All $TOTAL tests passed successfully!"
You can’t perform that action at this time.
0 commit comments