Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in parallel #363

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: python -Im flit build --format wheel

- name: 🧪 Run tox targets for Python ${{ matrix.python-version }}
run: tox --installpkg ./dist/*.whl
run: tox --installpkg ./dist/*.whl -- -v 1

- name: ⬆️ Upload coverage data
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -90,6 +90,7 @@ jobs:

- name: + Generate report
run: |
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
python -Im coverage report
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
Expand Down
5 changes: 5 additions & 0 deletions tests/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flit>=3.8
coverage[toml]>=7.0,<8.0
factory-boy==3.2.1
wagtail-factories>=4.1.0
tblib==1.7.0
16 changes: 5 additions & 11 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# Test requirements.
black>=23.7.0
ruff=0.0.285
pre-commit

# Runtime requirements
Django>=3.2,<5.0
wagtail>=4.1
graphene-django>=3.0.0
factory-boy==3.2.1
wagtail-factories>=4.1.0
django-cors-headers==3.4.0
django-cors-headers>=4.2.0
wagtailmedia>=0.13
wagtail-headless-preview
dj-database-url==2.1.0
# for postgres testing

psycopg2>=2.9.5,<3.0.0

# Test requirements.
-r requirements-dev.txt

# Your app in editable mode.
-e ../
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ setenv =
change_dir = {tox_root}/tests

deps =
flit>=3.8
coverage[toml]>=7.0,<8.0
factory-boy==3.2.1
wagtail-factories>=4.1.0
django-cors-headers==3.4.0
django-cors-headers>=4.2.0
wagtailmedia>=0.13
dj-database-url==2.1.0
psycopg2>=2.9.5,<3.0.0
-r {tox_root}/tests/requirements-test.txt

django32: Django>=3.2,<3.3
django41: Django>=4.1,<4.2
Expand All @@ -48,7 +45,7 @@ deps =
install_command = python -Im pip install -U {opts} {packages}

commands =
python -m coverage run manage.py test {posargs: -v 2}
python -m coverage run --parallel-mode manage.py test --parallel {posargs: -v 2}

[testenv:coverage-report]
; a bit of a hack - we keep deps to a minimum, and move coverage data to the tox root for easier excludes
Expand All @@ -60,6 +57,7 @@ pre_commands =
mv {tox_root}/tests/.coverage* {tox_root}/

commands =
python -Im coverage combine
python -Im coverage report -m

[testenv:wagtailmain]
Expand Down