Skip to content

Commit

Permalink
test using xdist for faster tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Jan 25, 2024
1 parent 110d99f commit 3853929
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ jobs:
- name: Test with pytest
run: |
python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$?
# run in parallel with xdist if not test_modules.py or test_subworkflows.py
if [ "${{ matrix.test }}" != "test_modules.py" ] && [ "${{ matrix.test }}" != "test_subworkflows.py" ]; then
python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n 2 && exit_code=0|| exit_code=$?
else
python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$?
# don't fail if no tests were collected, e.g. for test_licence.py
if [ "${exit_code}" -eq 5 ]; then
echo "No tests were collected"
Expand Down

0 comments on commit 3853929

Please sign in to comment.