Skip to content

Commit 7cef51c

Browse files
Allow expected non-zero (5) exit code in test workflows
1 parent 4894b4e commit 7cef51c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/run-test-suite.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ jobs:
112112
shell: bash -l {0}
113113
working-directory: ${{ github.workspace }}/main/cf/test
114114
run: |
115-
python create_test_files.py
115+
# Exit code 5 means no tests were found, which is expected for
116+
# create_test_files.py. Allow that code but fail the workflow
117+
# for any other non-zero exit code, to avoid hiding other failures.
118+
python create_test_files.py || test $? -eq 5
116119
python setup_create_field.py
117120
ls -la
118121

.github/workflows/test-source-dist.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ jobs:
104104
shell: bash -l {0}
105105
working-directory: ${{ github.workspace }}/main/cf/test
106106
run: |
107-
python create_test_files.py
107+
# Exit code 5 means no tests were found, which is expected for
108+
# create_test_files.py. Allow that code but fail the workflow
109+
# for any other non-zero exit code, to avoid hiding other failures.
110+
python create_test_files.py || test $? -eq 5
108111
python setup_create_field.py
109112
ls -la
110113

0 commit comments

Comments
 (0)