Skip to content

Commit

Permalink
Rename output coverage file to fix coverage upload
Browse files Browse the repository at this point in the history
Using pytest-xdist with pytest-cov creates a .coverage file,
not a file with the machine etc. suffix. Rename the file after
the tests such that it can be uploaded as an artifact with a unique
name compared to the coverage runs from the other jobs.
  • Loading branch information
amstilp committed May 7, 2024
1 parent ba4c8d8 commit 56fa15d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:
run: python manage.py collectstatic --noinput --settings=config.settings.test

- name: Run tests
run: pytest --cov=primed -n auto
run: |
pytest --cov=primed -n auto
mv .coverage .coverage-${{ strategy.job-index }}
- name: List files for debugging purposes
run: ls -lhta
Expand All @@ -87,7 +89,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ strategy.job-index }}
path: .coverage.*
path: .coverage-${{ strategy.job-index }}

coverage:
needs:
Expand Down

0 comments on commit 56fa15d

Please sign in to comment.