diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e12ace73..c53edf9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/tests/requirements-test.txt b/tests/requirements-test.txt new file mode 100644 index 00000000..7e8b13c4 --- /dev/null +++ b/tests/requirements-test.txt @@ -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 diff --git a/tests/requirements.txt b/tests/requirements.txt index 525c6585..89dfdc4a 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -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 ../ diff --git a/tox.ini b/tox.ini index 28f83568..e18fcc4c 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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 @@ -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]