Skip to content

Commit 650d466

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 650d466

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,27 @@ 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 +e
3033
python3 -m unittest discover --buffer scoring/
34+
result=$?
35+
set -x
36+
if [ "$result" -ne 0 ] && [ "$result" -ne 5 ]
37+
then
38+
exit $result
39+
fi
3140
3241
if [ -d scoring/tests/ ]
3342
then
43+
set +e
3444
python3 -m unittest discover --buffer scoring/tests/
45+
set -x
46+
result=$?
47+
if [ "$result" -ne 0 ] && [ "$result" -ne 5 ]
48+
then
49+
exit $result
50+
fi
3551
fi
3652
3753
- name: Run Compstate Validation

0 commit comments

Comments
 (0)