mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Use pytest as our test runner for better parallelism
Also rewrote some asset tests to be in the pytest style. May do some more. Some warnings cleaned up in the process.
This commit is contained in:
17
.github/workflows/django.yml
vendored
17
.github/workflows/django.yml
vendored
@@ -14,13 +14,7 @@ jobs:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
strategy:
|
||||
matrix:
|
||||
test-group: ["RIGS.tests.test_unit RIGS.tests.test_models RIGS.tests.test_functional", "versioning.tests.test_versioning", "users.tests.test_users"]
|
||||
parallel: [true]
|
||||
include:
|
||||
- test-group: "assets.tests.test_assets"
|
||||
parallel: false
|
||||
- test-group: "RIGS.tests.test_interaction"
|
||||
parallel: false
|
||||
test-group: ["RIGS/tests/", "versioning/tests/", "users/tests/", "assets/tests/"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
@@ -52,17 +46,14 @@ jobs:
|
||||
python manage.py check
|
||||
python manage.py makemigrations --check --dry-run
|
||||
- name: Run Tests
|
||||
if: \!${{ matrix.parallel }}
|
||||
run: coverage run manage.py test ${{ matrix.test-group }} --verbosity=2
|
||||
if: ${{ matrix.parallel }}
|
||||
run: coverage run -m pytest -n 8 ${{ matrix.test-group }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure() # Screenshots only make sense for the non-parallel, i.e. interaction tests anyway
|
||||
if: failure()
|
||||
with:
|
||||
name: failure-screenshots ${{ matrix.test-group }}
|
||||
path: screenshots/
|
||||
retention-days: 5
|
||||
- name: Run Tests (Parallel)
|
||||
if: ${{ matrix.parallel }}
|
||||
run: coverage run manage.py test ${{ matrix.test-group }} --parallel --verbosity=2
|
||||
- name: Upload Coverage
|
||||
run: coveralls --service=github
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user