Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Dec 19, 2024
1 parent d0cbc4d commit cd62ad6
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/shared-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,21 @@ jobs:
run: |
mvn -B clean compile test | tee build.log
echo $(( $(cat build.log | grep "Tests run" | grep -v "Time elapsed" | cut -d , -f 1 | cut -d " " -f 3 | tr "\n" "+") 0))
tests_run=$(cat build.log | grep "Tests run:" | tail -n 1 | sed 's/.*Tests run: \([0-9]*\).*/\1/')
# tests_run=$(cat build.log | awk '/Tests run: / {sum += $3} END {print sum}')
echo "DEBUG: tests_run = $tests_run"
# echo "DEBUG: tests_run = $tests_run"
if [ -z "$tests_run" ]; then
echo "WARNING: Could not determine the number of tests run."
tests_run=0
fi
# if [ -z "$tests_run" ]; then
# echo "WARNING: Could not determine the number of tests run."
# tests_run=0
# fi
if [ "$tests_run" -eq 0 ]; then
echo "ERROR: No tests were run!"
exit 1
fi
# if [ "$tests_run" -eq 0 ]; then
# echo "ERROR: No tests were run!"
# exit 1
# fi
# echo "INFO: $tests_run tests were run!"
echo "INFO: $tests_run tests were run!"
- name: Generate code coverage
if: ${{ inputs.vulnerability_scan_only == 'false' }}
Expand Down

0 comments on commit cd62ad6

Please sign in to comment.