Skip to content

Commit 4f2d208

Browse files
committed
Cope with exit code 5 when no tests are found
Maybe at some point this should be an option, however for now maintain the previous behaviour.
1 parent 1208ba4 commit 4f2d208

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,28 @@ runs:
2727
- name: Run Scoring tests
2828
shell: bash
2929
run: |
30+
# Do our own error handling as unittest discover exits with code 5 to
31+
# mean "no tests found", which is fine.
32+
set +x
33+
3034
python3 -m unittest discover --buffer scoring/
35+
result=$?
36+
set -x
37+
if [ "$result" -ne 0 ] && [ "$result" -ne 5 ]
38+
then
39+
exit $result
40+
fi
3141
3242
if [ -d scoring/tests/ ]
3343
then
44+
set +x
3445
python3 -m unittest discover --buffer scoring/tests/
46+
set -x
47+
result=$?
48+
if [ "$result" -ne 0 ] && [ "$result" -ne 5 ]
49+
then
50+
exit $result
51+
fi
3552
fi
3653
3754
- name: Run Compstate Validation

0 commit comments

Comments
 (0)