From 4e57e340fbf6b0902d8c60c01884a6acef675a2a Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 05:23:43 -0400 Subject: [PATCH 01/90] Attempt to make codecov less important --- .github/workflows/main.yml | 135 +++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d56f905e..794b1492 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,49 +20,11 @@ permissions: {} jobs: test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest continue-on-error: ${{ matrix.allow_failure }} - timeout-minutes: 15 + timeout-minutes: 5 permissions: contents: read - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Setup mysql - if: contains(matrix.name, 'mysql') - run: | - sudo systemctl start mysql.service - echo "TEST_DB_USER=root" >> $GITHUB_ENV - echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV - - - name: Setup postgresql - if: contains(matrix.name, 'postgres') - run: | - sudo systemctl start postgresql.service - sudo -u postgres createuser --createdb $USER - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==4.11.1 - - - name: Run tox - run: tox -e ${{ matrix.name }} - - - name: Report coverage - if: contains(matrix.name, 'coverage') - uses: codecov/codecov-action@v5 - with: - fail_ci_if_error: true - files: ./coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} - strategy: fail-fast: false matrix: @@ -144,14 +106,101 @@ jobs: - name: pypy3-dj42-postgres python: 'pypy3.9' allow_failure: false + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Setup mysql + if: contains(matrix.name, 'mysql') + run: | + sudo systemctl start mysql.service + echo "TEST_DB_USER=root" >> $GITHUB_ENV + echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV + + - name: Setup postgresql + if: contains(matrix.name, 'postgres') + run: | + sudo systemctl start postgresql.service + sudo -u postgres createuser --createdb $USER + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox==4.26.0 + + - name: Run tox + run: tox -e ${{ matrix.name }} + + - name: Prepare coverage file for upload + run: mv .coverage .coverage.${{ matrix.name }} + + - name: Upload temporary coverage artifact + uses: actions/upload-artifact@v4 + with: + name: coverage-artifact-${{ matrix.name }} + path: .coverage.${{ matrix.name }} + retention-days: 1 + + report-coverage: + name: Report Combined Coverage + runs-on: ubuntu-latest + needs: test + if: always() + permissions: + contents: read + actions: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install coverage tool + run: python -m pip install coverage[toml] + + - name: Download all coverage artifacts + uses: actions/download-artifact@v4 + with: + path: downloaded-coverage-artifacts + pattern: coverage-artifact-* + + - name: Combine coverage reports + run: | + mkdir combined_coverage_data + find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; + echo "Files in combined_coverage_data for combining:" + ls -R combined_coverage_data + cd combined_coverage_data + coverage combine --keep + echo "Combined .coverage file generated. Generating XML report." + coverage xml -o ../coverage.xml + cd .. + echo "Generated coverage.xml in workspace root:" + ls -l coverage.xml + + - name: Report coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true - check: # This job does nothing and is only used for the branch protection + check: if: always() needs: - - test + - report-coverage - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed From b4b91748ccb1ed0521e190e18a53f89b509e7ba3 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:15:49 -0400 Subject: [PATCH 02/90] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 794b1492..f4eb7060 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,7 +137,9 @@ jobs: run: tox -e ${{ matrix.name }} - name: Prepare coverage file for upload - run: mv .coverage .coverage.${{ matrix.name }} + run: | + ls -lash + mv .coverage .coverage.${{ matrix.name }} - name: Upload temporary coverage artifact uses: actions/upload-artifact@v4 From d85fe25b66950be835012473211c9401c140b372 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:23:39 -0400 Subject: [PATCH 03/90] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4eb7060..e02b2b9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,11 +137,13 @@ jobs: run: tox -e ${{ matrix.name }} - name: Prepare coverage file for upload + if: contains(matrix.name, 'coverage') run: | ls -lash mv .coverage .coverage.${{ matrix.name }} - name: Upload temporary coverage artifact + if: contains(matrix.name, 'coverage') uses: actions/upload-artifact@v4 with: name: coverage-artifact-${{ matrix.name }} From 4674b616192d671c38cf109b12b3f974ee578484 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:24:52 -0400 Subject: [PATCH 04/90] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e02b2b9f..0dcdc34c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,7 +131,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox==4.26.0 + pip install tox==4.24.0 - name: Run tox run: tox -e ${{ matrix.name }} From 8ee5187f1e9a60d9fca15601f4c3d5ebd2dea730 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:25:47 -0400 Subject: [PATCH 05/90] Update pyproject.toml --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3fb403da..aa623727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ classifiers = [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From e05f94e8a0332e47bf2dd45d1e3165bf47d22563 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:26:43 -0400 Subject: [PATCH 06/90] Update main.yml --- .github/workflows/main.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d56f905e..ec1afbbe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,15 +131,6 @@ jobs: python: '3.11' allow_failure: false - - name: py38-dj42-sqlite-xdist-coverage - python: '3.8' - allow_failure: false - - # Explicitly test min pytest. - - name: py38-dj42-sqlite-pytestmin-coverage - python: '3.8' - allow_failure: false - # pypy3: not included with coverage reports (much slower then). - name: pypy3-dj42-postgres python: 'pypy3.9' From ed346b6d0bee268c683dc8dc6535d35dbf49bdcb Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:28:56 -0400 Subject: [PATCH 07/90] Update contributing.rst --- docs/contributing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index d5003fc7..897d4ae0 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -140,10 +140,10 @@ writing), running them all will take a long time. All valid configurations can be found in `tox.ini`. To test against a few of them, invoke tox with the `-e` flag:: - $ tox -e py38-dj32-postgres,py310-dj41-mysql + $ tox -e py39-dj42-postgres,py310-dj52-mysql -This will run the tests on Python 3.8/Django 3.2/PostgeSQL and Python -3.10/Django 4.1/MySQL. +This will run the tests on Python 3.9/Django 4.2/PostgeSQL and Python +3.10/Django 5.2/MySQL. Measuring test coverage From 9faec5c9943535c84131ad58be37f7cb63da83e4 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:30:26 -0400 Subject: [PATCH 08/90] Update README.rst --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 90a9fb8d..87291333 100644 --- a/README.rst +++ b/README.rst @@ -32,9 +32,9 @@ pytest-django allows you to test your Django project/applications with the `_ * Version compatibility: - * Django: 4.2, 5.0, 5.1, 5.2 and latest main branch (compatible at the time + * Django: 4.2, 5.1, 5.2 and latest main branch (compatible at the time of each release) - * Python: CPython>=3.8 or PyPy 3 + * Python: CPython>=3.9 or PyPy 3 * pytest: >=7.0 For compatibility with older versions, use previous pytest-django releases. From 73883c5221ade9eb27224ddc240b6aa311e9a747 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:31:29 -0400 Subject: [PATCH 09/90] Update pyproject.toml --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa623727..61f2c006 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" name = "pytest-django" description = "A Django plugin for pytest." readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = ["version"] authors = [ { name = "Andreas Pelme", email = "andreas@pelme.se" }, @@ -22,7 +22,6 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Django :: 4.2", - "Framework :: Django :: 5.0", "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", "Intended Audience :: Developers", From a0c7a972be5c9192404e8883c7007a33564ae00b Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:32:32 -0400 Subject: [PATCH 10/90] Update tox.ini --- tox.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index aed0b8a3..e064bc0c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] envlist = py313-dj{main,52,51}-postgres - py312-dj{main,52,51,50,42}-postgres - py311-dj{main,52,51,50,42}-postgres - py310-dj{main,52,51,50,42}-postgres + py312-dj{main,52,51,42}-postgres + py311-dj{main,52,51,42}-postgres + py310-dj{main,52,51,42}-postgres py39-dj42-postgres - py38-dj42-postgres linting [testenv] From 71151c26555cb113608fdab87edcfd8055e4fea4 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 10:40:46 -0400 Subject: [PATCH 11/90] Minor import fixes (100% automatic) --- pytest_django/asserts.py | 3 ++- pytest_django/fixtures.py | 4 +--- pytest_django/plugin.py | 3 ++- pytest_django/runner.py | 3 ++- pytest_django_test/db_helpers.py | 2 +- tests/test_database.py | 2 +- tests/test_fixtures.py | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pytest_django/asserts.py b/pytest_django/asserts.py index 14741066..0401b2ea 100644 --- a/pytest_django/asserts.py +++ b/pytest_django/asserts.py @@ -4,8 +4,9 @@ from __future__ import annotations +from collections.abc import Sequence from functools import wraps -from typing import TYPE_CHECKING, Any, Callable, Sequence +from typing import TYPE_CHECKING, Any, Callable from django import VERSION from django.test import LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 6dc05fdb..358bfd68 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -3,6 +3,7 @@ from __future__ import annotations import os +from collections.abc import Generator, Iterable, Sequence from contextlib import contextmanager from functools import partial from typing import ( @@ -11,13 +12,10 @@ Any, Callable, ContextManager, - Generator, - Iterable, List, Literal, Optional, Protocol, - Sequence, Tuple, Union, ) diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index e8e629f4..e2a73c82 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -12,8 +12,9 @@ import pathlib import sys import types +from collections.abc import Generator from functools import reduce -from typing import TYPE_CHECKING, ContextManager, Generator, List, NoReturn +from typing import TYPE_CHECKING, ContextManager, List, NoReturn import pytest diff --git a/pytest_django/runner.py b/pytest_django/runner.py index d9032622..1b6571cc 100644 --- a/pytest_django/runner.py +++ b/pytest_django/runner.py @@ -1,5 +1,6 @@ from argparse import ArgumentParser -from typing import Any, Iterable +from collections.abc import Iterable +from typing import Any class TestRunner: diff --git a/pytest_django_test/db_helpers.py b/pytest_django_test/db_helpers.py index 712af0d3..b9efe86d 100644 --- a/pytest_django_test/db_helpers.py +++ b/pytest_django_test/db_helpers.py @@ -3,7 +3,7 @@ import os import sqlite3 import subprocess -from typing import Mapping +from collections.abc import Mapping import pytest from django.conf import settings diff --git a/tests/test_database.py b/tests/test_database.py index c6389756..2fec1352 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Generator +from collections.abc import Generator import pytest from django.db import connection, transaction diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index f88ed802..709ae6c9 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -5,8 +5,8 @@ """ import socket +from collections.abc import Generator from contextlib import contextmanager -from typing import Generator from urllib.error import HTTPError from urllib.request import urlopen From bb091a526b55dddf1f7ceb8f62c7868d12b4e523 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 10:47:11 -0400 Subject: [PATCH 12/90] Minor import fixes (100% manual) --- pytest_django/fixtures.py | 24 ++++++------------------ pytest_django/plugin.py | 9 +++++---- tests/test_runner.py | 2 +- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 358bfd68..c1bf9ca1 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -4,21 +4,9 @@ import os from collections.abc import Generator, Iterable, Sequence -from contextlib import contextmanager +from contextlib import AbstractContextManager, contextmanager from functools import partial -from typing import ( - TYPE_CHECKING, - AbstractSet, - Any, - Callable, - ContextManager, - List, - Literal, - Optional, - Protocol, - Tuple, - Union, -) +from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Protocol, Union import pytest @@ -35,9 +23,9 @@ _DjangoDbDatabases = Optional[Union[Literal["__all__"], Iterable[str]]] -_DjangoDbAvailableApps = Optional[List[str]] +_DjangoDbAvailableApps = Optional[list[str]] # transaction, reset_sequences, databases, serialized_rollback, available_apps -_DjangoDb = Tuple[bool, bool, _DjangoDbDatabases, bool, _DjangoDbAvailableApps] +_DjangoDb = tuple[bool, bool, _DjangoDbDatabases, bool, _DjangoDbAvailableApps] __all__ = [ @@ -155,7 +143,7 @@ def _get_databases_for_test(test: pytest.Item) -> tuple[Iterable[str], bool]: def _get_databases_for_setup( items: Sequence[pytest.Item], -) -> tuple[AbstractSet[str], AbstractSet[str]]: +) -> tuple[set[str], set[str]]: """Get the database aliases that need to be setup, and the subset that needs to be serialized.""" # Code derived from django.test.utils.DiscoverRunner.get_databases(). @@ -734,7 +722,7 @@ def __call__( *, using: str = ..., execute: bool = ..., - ) -> ContextManager[list[Callable[[], Any]]]: + ) -> AbstractContextManager[list[Callable[[], Any]]]: pass # pragma: no cover diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index e2a73c82..00c3744b 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -13,8 +13,9 @@ import sys import types from collections.abc import Generator +from contextlib import AbstractContextManager from functools import reduce -from typing import TYPE_CHECKING, ContextManager, List, NoReturn +from typing import TYPE_CHECKING, NoReturn import pytest @@ -260,7 +261,7 @@ def _get_boolean_value( ) from None -report_header_key = pytest.StashKey[List[str]]() +report_header_key = pytest.StashKey[list[str]]() @pytest.hookimpl() @@ -838,13 +839,13 @@ def _blocking_wrapper(*args, **kwargs) -> NoReturn: '"db" or "transactional_db" fixtures to enable it.' ) - def unblock(self) -> ContextManager[None]: + def unblock(self) -> AbstractContextManager[None]: """Enable access to the Django database.""" self._save_active_wrapper() self._dj_db_wrapper.ensure_connection = self._real_ensure_connection return _DatabaseBlockerContextManager(self) - def block(self) -> ContextManager[None]: + def block(self) -> AbstractContextManager[None]: """Disable access to the Django database.""" self._save_active_wrapper() self._dj_db_wrapper.ensure_connection = self._blocking_wrapper diff --git a/tests/test_runner.py b/tests/test_runner.py index 71fd7160..a0bee059 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -6,7 +6,7 @@ @pytest.mark.parametrize( - "kwargs, expected", + ("kwargs", "expected"), [ ({}, call(["tests"])), ({"verbosity": 0}, call(["--quiet", "tests"])), From ce156bec542e4d5107843e4a6fcad46ca0cc36f7 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:15:57 -0400 Subject: [PATCH 13/90] Update main.yml --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcc57620..5c0a7532 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,8 +93,7 @@ jobs: python: '3.11' allow_failure: false - # pypy3: not included with coverage reports (much slower then). - - name: pypy3-dj42-postgres + - name: pypy3-dj42-postgres-coverage python: 'pypy3.9' allow_failure: false steps: From 3dadd6794791736087d602d4128b6093fd793ff9 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:19:08 -0400 Subject: [PATCH 14/90] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c0a7532..ccffc63c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,7 +121,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox==4.24.0 + pip install tox==4.26.0 - name: Run tox run: tox -e ${{ matrix.name }} From 95981481fd846938236eab1638d4723ba6e149e8 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:21:16 -0400 Subject: [PATCH 15/90] Update main.yml --- .github/workflows/main.yml | 122 ++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ccffc63c..83cd0ab4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,64 +140,64 @@ jobs: path: .coverage.${{ matrix.name }} retention-days: 1 - report-coverage: - name: Report Combined Coverage - runs-on: ubuntu-latest - needs: test - if: always() - permissions: - contents: read - actions: read - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install coverage tool - run: python -m pip install coverage[toml] - - - name: Download all coverage artifacts - uses: actions/download-artifact@v4 - with: - path: downloaded-coverage-artifacts - pattern: coverage-artifact-* - - - name: Combine coverage reports - run: | - mkdir combined_coverage_data - find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; - echo "Files in combined_coverage_data for combining:" - ls -R combined_coverage_data - cd combined_coverage_data - coverage combine --keep - echo "Combined .coverage file generated. Generating XML report." - coverage xml -o ../coverage.xml - cd .. - echo "Generated coverage.xml in workspace root:" - ls -l coverage.xml - - - name: Report coverage to Codecov - uses: codecov/codecov-action@v5 - with: - files: ./coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true - - check: - if: always() - - needs: - - report-coverage - - runs-on: ubuntu-latest - - steps: - - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 - with: - jobs: ${{ toJSON(needs) }} + # report-coverage: + # name: Report Combined Coverage + # runs-on: ubuntu-latest + # needs: test + # if: always() + # permissions: + # contents: read + # actions: read + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' + + # - name: Install coverage tool + # run: python -m pip install coverage[toml] + + # - name: Download all coverage artifacts + # uses: actions/download-artifact@v4 + # with: + # path: downloaded-coverage-artifacts + # pattern: coverage-artifact-* + + # - name: Combine coverage reports + # run: | + # mkdir combined_coverage_data + # find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; + # echo "Files in combined_coverage_data for combining:" + # ls -R combined_coverage_data + # cd combined_coverage_data + # coverage combine --keep + # echo "Combined .coverage file generated. Generating XML report." + # coverage xml -o ../coverage.xml + # cd .. + # echo "Generated coverage.xml in workspace root:" + # ls -l coverage.xml + + # - name: Report coverage to Codecov + # uses: codecov/codecov-action@v5 + # with: + # files: ./coverage.xml + # token: ${{ secrets.CODECOV_TOKEN }} + # fail_ci_if_error: true + # verbose: true + + # check: + # if: always() + + # needs: + # - report-coverage + + # runs-on: ubuntu-latest + + # steps: + # - name: Decide whether the needed jobs succeeded or failed + # uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 + # with: + # jobs: ${{ toJSON(needs) }} From b2e9a9d62d4a0c93578b3a734017e22d6b055754 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:27:23 -0400 Subject: [PATCH 16/90] Update main.yml --- .github/workflows/main.yml | 126 ++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 64 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 83cd0ab4..65bee860 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,9 +128,7 @@ jobs: - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') - run: | - ls -lash - mv .coverage .coverage.${{ matrix.name }} + run: mv .coverage .coverage.${{ matrix.name }} - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') @@ -140,64 +138,64 @@ jobs: path: .coverage.${{ matrix.name }} retention-days: 1 - # report-coverage: - # name: Report Combined Coverage - # runs-on: ubuntu-latest - # needs: test - # if: always() - # permissions: - # contents: read - # actions: read - # steps: - # - uses: actions/checkout@v4 - # with: - # persist-credentials: false - - # - uses: actions/setup-python@v5 - # with: - # python-version: '3.11' - - # - name: Install coverage tool - # run: python -m pip install coverage[toml] - - # - name: Download all coverage artifacts - # uses: actions/download-artifact@v4 - # with: - # path: downloaded-coverage-artifacts - # pattern: coverage-artifact-* - - # - name: Combine coverage reports - # run: | - # mkdir combined_coverage_data - # find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; - # echo "Files in combined_coverage_data for combining:" - # ls -R combined_coverage_data - # cd combined_coverage_data - # coverage combine --keep - # echo "Combined .coverage file generated. Generating XML report." - # coverage xml -o ../coverage.xml - # cd .. - # echo "Generated coverage.xml in workspace root:" - # ls -l coverage.xml - - # - name: Report coverage to Codecov - # uses: codecov/codecov-action@v5 - # with: - # files: ./coverage.xml - # token: ${{ secrets.CODECOV_TOKEN }} - # fail_ci_if_error: true - # verbose: true - - # check: - # if: always() - - # needs: - # - report-coverage - - # runs-on: ubuntu-latest - - # steps: - # - name: Decide whether the needed jobs succeeded or failed - # uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 - # with: - # jobs: ${{ toJSON(needs) }} + report-coverage: + name: Report Combined Coverage + runs-on: ubuntu-latest + needs: test + if: always() + permissions: + contents: read + actions: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install coverage tool + run: python -m pip install coverage[toml] + + - name: Download all coverage artifacts + uses: actions/download-artifact@v4 + with: + path: downloaded-coverage-artifacts + pattern: coverage-artifact-* + + - name: Combine coverage reports + run: | + mkdir combined_coverage_data + find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; + echo "Files in combined_coverage_data for combining:" + ls -R combined_coverage_data + cd combined_coverage_data + coverage combine --keep + echo "Combined .coverage file generated. Generating XML report." + coverage xml -o ../coverage.xml + cd .. + echo "Generated coverage.xml in workspace root:" + ls -l coverage.xml + + - name: Report coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true + + check: + if: always() + + needs: + - report-coverage + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 + with: + jobs: ${{ toJSON(needs) }} From 454fc18fa933a57b8e0e7d1f003b4c8e988c0813 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 12:33:21 -0400 Subject: [PATCH 17/90] Add debug output to coverage file preparation in main.yml --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65bee860..87c7f602 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,7 +128,10 @@ jobs: - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') - run: mv .coverage .coverage.${{ matrix.name }} + run: | + ls -lash + mv .coverage .coverage.${{ matrix.name }} + ls -lash - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') From 574dea3576d09da9cc6008b39d13606d06397931 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 12:35:15 -0400 Subject: [PATCH 18/90] Remove coverage report and XML generation commands from tox.ini --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index e064bc0c..410daf2d 100644 --- a/tox.ini +++ b/tox.ini @@ -42,8 +42,6 @@ commands = coverage: coverage erase {env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests} coverage: coverage combine - coverage: coverage report - coverage: coverage xml [testenv:linting] extras = From 5f92bc24633c4a0702eb2167285abe3d07fbf0a4 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 12:43:41 -0400 Subject: [PATCH 19/90] Refactor coverage artifact naming in main.yml to remove leading dot --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87c7f602..8c33e795 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,7 @@ jobs: if: contains(matrix.name, 'coverage') run: | ls -lash - mv .coverage .coverage.${{ matrix.name }} + mv .coverage coverage.${{ matrix.name }} ls -lash - name: Upload temporary coverage artifact @@ -138,7 +138,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage-artifact-${{ matrix.name }} - path: .coverage.${{ matrix.name }} + path: coverage.${{ matrix.name }} retention-days: 1 report-coverage: From 0dff300ad3c8d17e443863b8cf7598764c24aabe Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 12:46:23 -0400 Subject: [PATCH 20/90] Streamline event triggers in main.yml to use array syntax for push and pull_request --- .github/workflows/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c33e795..e6176b3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,6 @@ name: main -on: - push: - branches: - - main - pull_request: - branches: - - main +on: [push, pull_request] concurrency: group: ci-main-${{ github.ref }} From f9bd682225a2db87c0622a96bdde65e513dd6658 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 12:55:27 -0400 Subject: [PATCH 21/90] . --- .github/workflows/main.yml | 84 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6176b3d..4c9cd649 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: test: runs-on: ubuntu-latest continue-on-error: ${{ matrix.allow_failure }} - timeout-minutes: 5 + timeout-minutes: 15 permissions: contents: read strategy: @@ -27,53 +27,53 @@ jobs: python: '3.13' allow_failure: false - - name: py313-dj52-postgres-xdist-coverage - python: '3.13' - allow_failure: false + # - name: py313-dj52-postgres-xdist-coverage + # python: '3.13' + # allow_failure: false - - name: py313-dj51-postgres-xdist-coverage - python: '3.13' - allow_failure: false + # - name: py313-dj51-postgres-xdist-coverage + # python: '3.13' + # allow_failure: false - - name: py312-dj42-postgres-xdist-coverage - python: '3.12' - allow_failure: false + # - name: py312-dj42-postgres-xdist-coverage + # python: '3.12' + # allow_failure: false - - name: py311-dj50-postgres-xdist-coverage - python: '3.11' - allow_failure: false + # - name: py311-dj50-postgres-xdist-coverage + # python: '3.11' + # allow_failure: false - - name: py311-dj42-postgres-xdist-coverage - python: '3.11' - allow_failure: false + # - name: py311-dj42-postgres-xdist-coverage + # python: '3.11' + # allow_failure: false - - name: py310-dj52-postgres-xdist-coverage - python: '3.10' - allow_failure: false + # - name: py310-dj52-postgres-xdist-coverage + # python: '3.10' + # allow_failure: false - - name: py310-dj51-postgres-xdist-coverage - python: '3.10' - allow_failure: false + # - name: py310-dj51-postgres-xdist-coverage + # python: '3.10' + # allow_failure: false - - name: py310-dj42-postgres-xdist-coverage - python: '3.10' - allow_failure: false + # - name: py310-dj42-postgres-xdist-coverage + # python: '3.10' + # allow_failure: false - - name: py311-dj51-mysql-coverage - python: '3.11' - allow_failure: false + # - name: py311-dj51-mysql-coverage + # python: '3.11' + # allow_failure: false - - name: py310-dj42-mysql-coverage - python: '3.10' - allow_failure: false + # - name: py310-dj42-mysql-coverage + # python: '3.10' + # allow_failure: false - - name: py39-dj42-mysql-xdist-coverage - python: '3.9' - allow_failure: false + # - name: py39-dj42-mysql-xdist-coverage + # python: '3.9' + # allow_failure: false - - name: py313-djmain-sqlite-coverage - python: '3.13' - allow_failure: true + # - name: py313-djmain-sqlite-coverage + # python: '3.13' + # allow_failure: true - name: py313-dj52-sqlite-coverage python: '3.13' @@ -87,9 +87,9 @@ jobs: python: '3.11' allow_failure: false - - name: pypy3-dj42-postgres-coverage - python: 'pypy3.9' - allow_failure: false + # - name: pypy3-dj42-postgres-coverage + # python: 'pypy3.9' + # allow_failure: false steps: - uses: actions/checkout@v4 with: @@ -164,11 +164,11 @@ jobs: - name: Combine coverage reports run: | mkdir combined_coverage_data - find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; + find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; echo "Files in combined_coverage_data for combining:" ls -R combined_coverage_data cd combined_coverage_data - coverage combine --keep + coverage combine echo "Combined .coverage file generated. Generating XML report." coverage xml -o ../coverage.xml cd .. From 77a07e2eda2ab18bf7f07826d28765b4584a0fcc Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 13:04:09 -0400 Subject: [PATCH 22/90] Enhance main.yml workflow by refining event triggers and simplifying coverage file handling --- .github/workflows/main.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c9cd649..b977add7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,14 @@ name: main -on: [push, pull_request] +on: + push: + branches: + - main + tags: + - "*" + pull_request: + branches: + - "*" concurrency: group: ci-main-${{ github.ref }} @@ -122,10 +130,7 @@ jobs: - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') - run: | - ls -lash - mv .coverage coverage.${{ matrix.name }} - ls -lash + run: mv .coverage coverage.${{ matrix.name }} - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') @@ -167,13 +172,9 @@ jobs: find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; echo "Files in combined_coverage_data for combining:" ls -R combined_coverage_data - cd combined_coverage_data - coverage combine - echo "Combined .coverage file generated. Generating XML report." - coverage xml -o ../coverage.xml - cd .. - echo "Generated coverage.xml in workspace root:" - ls -l coverage.xml + coverage combine .converge combined_coverage_data/* + coverage xml + ls -lsad - name: Report coverage to Codecov uses: codecov/codecov-action@v5 From ef377e5e69dae1c94d957afd882f5689b2122e3e Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 13:05:14 -0400 Subject: [PATCH 23/90] . --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b977add7..c91709d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,8 +7,6 @@ on: tags: - "*" pull_request: - branches: - - "*" concurrency: group: ci-main-${{ github.ref }} From d795df0a6a747e880b1febe69198c94df07db248 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 13:08:30 -0400 Subject: [PATCH 24/90] . --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c91709d4..fd9c930f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -170,7 +170,7 @@ jobs: find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; echo "Files in combined_coverage_data for combining:" ls -R combined_coverage_data - coverage combine .converge combined_coverage_data/* + coverage combine combined_coverage_data/* coverage xml ls -lsad From 48e6ea91989e9b8609501f7580da94348a3950c1 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 17:46:29 -0400 Subject: [PATCH 25/90] Update pyproject.toml to exclude pytest_django/_version.py from coverage --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 61f2c006..f7de67aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,9 @@ include = [ "pytest_django_test/*", "tests/*", ] +exclude = [ + "pytest_django/_version.py", +] skip_covered = true exclude_lines = [ "pragma: no cover", From a36659e7b81092bbd51816e8a73d84f30d2d9123 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 18:01:19 -0400 Subject: [PATCH 26/90] Refactor coverage configuration in pyproject.toml to include and omit specific files --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f7de67aa..7ddff77b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,15 +97,15 @@ ignore_missing_imports = true parallel = true source = ["${PYTESTDJANGO_COVERAGE_SRC}."] branch = true +omit = [ + "pytest_django/_version.py", +] [tool.coverage.report] include = [ "pytest_django/*", "pytest_django_test/*", "tests/*", ] -exclude = [ - "pytest_django/_version.py", -] skip_covered = true exclude_lines = [ "pragma: no cover", From 45cb413c18f4333ee3902defa692bd193eedf2eb Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 18:11:21 -0400 Subject: [PATCH 27/90] . --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 7ddff77b..f60beafd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,6 +106,9 @@ include = [ "pytest_django_test/*", "tests/*", ] +omit = [ + "pytest_django/_version.py", +] skip_covered = true exclude_lines = [ "pragma: no cover", From 9f9cf83ff92d8e42d5fd03283aaf38200e6ccb68 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 27 May 2025 01:44:59 -0400 Subject: [PATCH 28/90] Update main.yml --- .github/workflows/main.yml | 144 ++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5745c184..7e231573 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,78 +29,78 @@ jobs: fail-fast: false matrix: include: - - name: linting,docs - python: '3.13' - allow_failure: false - -# # Explicitly test min pytest. -# - name: py313-dj52-sqlite-pytestmin-coverage -# python: '3.13' -# allow_failure: false - - # - name: py313-dj52-postgres-xdist-coverage - # python: '3.13' - # allow_failure: false - - # - name: py313-dj51-postgres-xdist-coverage - # python: '3.13' - # allow_failure: false - - # - name: py312-dj42-postgres-xdist-coverage - # python: '3.12' - # allow_failure: false - - # - name: py311-dj50-postgres-xdist-coverage - # python: '3.11' - # allow_failure: false - - # - name: py311-dj42-postgres-xdist-coverage - # python: '3.11' - # allow_failure: false - - # - name: py310-dj52-postgres-xdist-coverage - # python: '3.10' - # allow_failure: false - - # - name: py310-dj51-postgres-xdist-coverage - # python: '3.10' - # allow_failure: false - - # - name: py310-dj42-postgres-xdist-coverage - # python: '3.10' - # allow_failure: false - - # - name: py311-dj51-mysql-coverage - # python: '3.11' - # allow_failure: false - - # - name: py310-dj42-mysql-coverage - # python: '3.10' - # allow_failure: false - - # - name: py39-dj42-mysql-xdist-coverage - # python: '3.9' - # allow_failure: false - - # - name: py313-djmain-sqlite-coverage - # python: '3.13' - # allow_failure: true - - - name: py313-dj52-sqlite-coverage - python: '3.13' - allow_failure: true - - - name: py312-dj51-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - - - name: py311-dj42-sqlite-xdist-coverage - python: '3.11' - allow_failure: false - - # - name: pypy3-dj42-postgres-coverage - # python: 'pypy3.9' - # allow_failure: false + - name: linting,docs + python: '3.13' + allow_failure: false + + # Explicitly test min pytest. + - name: py313-dj52-sqlite-pytestmin-coverage + python: '3.13' + allow_failure: false + + - name: py313-dj52-postgres-xdist-coverage + python: '3.13' + allow_failure: false + + - name: py313-dj51-postgres-xdist-coverage + python: '3.13' + allow_failure: false + + - name: py312-dj42-postgres-xdist-coverage + python: '3.12' + allow_failure: false + + - name: py311-dj50-postgres-xdist-coverage + python: '3.11' + allow_failure: false + + - name: py311-dj42-postgres-xdist-coverage + python: '3.11' + allow_failure: false + + - name: py310-dj52-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py310-dj51-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py310-dj42-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py311-dj51-mysql-coverage + python: '3.11' + allow_failure: false + + - name: py310-dj42-mysql-coverage + python: '3.10' + allow_failure: false + + - name: py39-dj42-mysql-xdist-coverage + python: '3.9' + allow_failure: false + + - name: py313-djmain-sqlite-coverage + python: '3.13' + allow_failure: true + + - name: py313-dj52-sqlite-coverage + python: '3.13' + allow_failure: true + + - name: py312-dj51-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + + - name: py311-dj42-sqlite-xdist-coverage + python: '3.11' + allow_failure: false + + - name: pypy3-dj42-postgres-coverage + python: 'pypy3.9' + allow_failure: false steps: - uses: actions/checkout@v4 with: From 9bff05a900546ac376d545a604f5d2765a763414 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 27 May 2025 02:11:28 -0400 Subject: [PATCH 29/90] Update main.yml --- .github/workflows/main.yml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e231573..7d6b9aff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,73 +32,74 @@ jobs: - name: linting,docs python: '3.13' allow_failure: false - + # Explicitly test min pytest. - name: py313-dj52-sqlite-pytestmin-coverage python: '3.13' allow_failure: false - + - name: py313-dj52-postgres-xdist-coverage python: '3.13' allow_failure: false - + - name: py313-dj51-postgres-xdist-coverage python: '3.13' allow_failure: false - + - name: py312-dj42-postgres-xdist-coverage python: '3.12' allow_failure: false - + - name: py311-dj50-postgres-xdist-coverage python: '3.11' allow_failure: false - + - name: py311-dj42-postgres-xdist-coverage python: '3.11' allow_failure: false - + - name: py310-dj52-postgres-xdist-coverage python: '3.10' allow_failure: false - + - name: py310-dj51-postgres-xdist-coverage python: '3.10' allow_failure: false - + - name: py310-dj42-postgres-xdist-coverage python: '3.10' allow_failure: false - + - name: py311-dj51-mysql-coverage python: '3.11' allow_failure: false - + - name: py310-dj42-mysql-coverage python: '3.10' allow_failure: false - + - name: py39-dj42-mysql-xdist-coverage python: '3.9' allow_failure: false - + - name: py313-djmain-sqlite-coverage python: '3.13' allow_failure: true - + - name: py313-dj52-sqlite-coverage python: '3.13' allow_failure: true - + - name: py312-dj51-sqlite-xdist-coverage python: '3.12' allow_failure: false - + - name: py311-dj42-sqlite-xdist-coverage python: '3.11' allow_failure: false - - - name: pypy3-dj42-postgres-coverage + + # pypy3: not included with coverage reports (much slower then). + - name: pypy3-dj42-postgres python: 'pypy3.9' allow_failure: false steps: From a5d66c7ed7752c8c746741a19ba4d92410c70e9b Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 27 May 2025 02:16:39 -0400 Subject: [PATCH 30/90] Update main.yml --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7d6b9aff..24a448b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -159,7 +159,8 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.13' + check-latest: true - name: Install coverage tool run: python -m pip install coverage[toml] @@ -174,11 +175,8 @@ jobs: run: | mkdir combined_coverage_data find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; - echo "Files in combined_coverage_data for combining:" - ls -R combined_coverage_data coverage combine combined_coverage_data/* coverage xml - ls -lsad - name: Report coverage to Codecov uses: codecov/codecov-action@v5 @@ -188,7 +186,7 @@ jobs: fail_ci_if_error: true verbose: true - check: + check: # This job does nothing and is only used for the branch protection if: always() needs: From 1ffc476fe0a2b8fae989d008e99a7fe7925ff528 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 02:22:24 -0400 Subject: [PATCH 31/90] . --- .github/workflows/main.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24a448b6..3b81ea1b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -151,7 +151,7 @@ jobs: if: always() permissions: contents: read - actions: read + actions: write steps: - uses: actions/checkout@v4 with: @@ -177,6 +177,27 @@ jobs: find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; coverage combine combined_coverage_data/* coverage xml + coverage html + + - name: Upload combined .coverage file + uses: actions/upload-artifact@v4 + with: + name: combined-coverage-file + path: .coverage + retention-days: 1 + include-hidden-files: true + + - name: Upload HTML coverage report + uses: actions/upload-artifact@v4 + with: + name: html-coverage-report + path: htmlcov + retention-days: 1 + + - name: Delete temporary coverage artifacts from run + uses: geekyeggo/delete-artifact@v5 + with: + name: coverage-artifact-* - name: Report coverage to Codecov uses: codecov/codecov-action@v5 From 186dcc46de77210461b1642c30efdeed2096c8b1 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 02:27:23 -0400 Subject: [PATCH 32/90] Enhance coverage report configuration in main.yml to include markdown output and adjust retention days based on branch or tag. --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b81ea1b..f3149b0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -178,21 +178,22 @@ jobs: coverage combine combined_coverage_data/* coverage xml coverage html + coverage report --format=markdown >> $GITHUB_STEP_SUMMARY - name: Upload combined .coverage file uses: actions/upload-artifact@v4 with: - name: combined-coverage-file + name: coverage-file path: .coverage - retention-days: 1 + retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }} include-hidden-files: true - name: Upload HTML coverage report uses: actions/upload-artifact@v4 with: - name: html-coverage-report + name: coverage-html-report path: htmlcov - retention-days: 1 + retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }} - name: Delete temporary coverage artifacts from run uses: geekyeggo/delete-artifact@v5 From e3a6ea1db5c85d9816801ee61be8d14e07911325 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 02:33:52 -0400 Subject: [PATCH 33/90] Remove pytest_django/_version.py from coverage omission list in pyproject.toml --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f60beafd..7ddff77b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,9 +106,6 @@ include = [ "pytest_django_test/*", "tests/*", ] -omit = [ - "pytest_django/_version.py", -] skip_covered = true exclude_lines = [ "pragma: no cover", From febb65c27edd2adbe0f546e3a54faab205723729 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 02:39:34 -0400 Subject: [PATCH 34/90] ..i think copilot led me down the wrong road --- pyproject.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7ddff77b..7d16dfe8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,15 +97,18 @@ ignore_missing_imports = true parallel = true source = ["${PYTESTDJANGO_COVERAGE_SRC}."] branch = true -omit = [ - "pytest_django/_version.py", -] +# omit = [ +# "pytest_django/_version.py", +# ] [tool.coverage.report] include = [ "pytest_django/*", "pytest_django_test/*", "tests/*", ] +omit = [ + "pytest_django/_version.py", +] skip_covered = true exclude_lines = [ "pragma: no cover", From a946de141fc8230c1c3e07facf176a12d4948194 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 02:43:46 -0400 Subject: [PATCH 35/90] Ok not soo wrong.. --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7d16dfe8..2247e90e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,9 +97,6 @@ ignore_missing_imports = true parallel = true source = ["${PYTESTDJANGO_COVERAGE_SRC}."] branch = true -# omit = [ -# "pytest_django/_version.py", -# ] [tool.coverage.report] include = [ "pytest_django/*", From e38450f21fccde71516c1e3f2d02631aa01006a9 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 27 May 2025 09:46:50 +0200 Subject: [PATCH 36/90] Update main.yml --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3149b0c..d3531e96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ permissions: {} jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 continue-on-error: ${{ matrix.allow_failure }} timeout-minutes: 15 permissions: @@ -146,7 +146,7 @@ jobs: report-coverage: name: Report Combined Coverage - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: test if: always() permissions: @@ -160,7 +160,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.13' - check-latest: true - name: Install coverage tool run: python -m pip install coverage[toml] @@ -214,7 +213,7 @@ jobs: needs: - report-coverage - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Decide whether the needed jobs succeeded or failed From 917a32625b1c1367d0d6da19563d9f47a3b34d64 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 08:45:07 -0400 Subject: [PATCH 37/90] Refactor retention days logic in main.yml to use a dedicated step for better clarity and maintainability. --- .github/workflows/main.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3531e96..a2258739 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -179,12 +179,21 @@ jobs: coverage html coverage report --format=markdown >> $GITHUB_STEP_SUMMARY + - name: Determine retention days + id: determine-retention-days + run: | + if [ "${{ github.ref }}" = "refs/heads/main" ] || [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "retention_days=90" >> $GITHUB_OUTPUT + else + echo "retention_days=3" >> $GITHUB_OUTPUT + fi + - name: Upload combined .coverage file uses: actions/upload-artifact@v4 with: name: coverage-file path: .coverage - retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }} + retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} include-hidden-files: true - name: Upload HTML coverage report @@ -192,7 +201,7 @@ jobs: with: name: coverage-html-report path: htmlcov - retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }} + retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - name: Delete temporary coverage artifacts from run uses: geekyeggo/delete-artifact@v5 From 82180a575a90ce48fb0d5c2999d64692808d298c Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 09:24:48 -0400 Subject: [PATCH 38/90] Unify tests for speed --- .github/workflows/main.yml | 71 +++++++++++--------------------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a2258739..6b1ab294 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,75 +33,46 @@ jobs: python: '3.13' allow_failure: false - # Explicitly test min pytest. - - name: py313-dj52-sqlite-pytestmin-coverage + - name: py313-sqlite-xdist-coverage python: '3.13' allow_failure: false - - name: py313-dj52-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py313-dj51-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py312-dj42-postgres-xdist-coverage + - name: py312-sqlite-xdist-coverage python: '3.12' allow_failure: false - - name: py311-dj50-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py311-dj42-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py310-dj52-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj51-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj42-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py311-dj51-mysql-coverage + - name: py311-sqlite-xdist-coverage python: '3.11' allow_failure: false - - name: py310-dj42-mysql-coverage + - name: py310-sqlite-xdist-coverage python: '3.10' allow_failure: false - - name: py39-dj42-mysql-xdist-coverage + - name: py39-sqlite-xdist-coverage python: '3.9' allow_failure: false - - name: py313-djmain-sqlite-coverage - python: '3.13' - allow_failure: true + # - name: py313-sqlite-coverage + # python: '3.13' + # allow_failure: true - - name: py313-dj52-sqlite-coverage - python: '3.13' - allow_failure: true + # - name: py313-dj52-sqlite-coverage + # python: '3.13' + # allow_failure: true - - name: py312-dj51-sqlite-xdist-coverage - python: '3.12' - allow_failure: false + # - name: py312-dj51-sqlite-xdist-coverage + # python: '3.12' + # allow_failure: false - - name: py311-dj42-sqlite-xdist-coverage - python: '3.11' - allow_failure: false + # - name: py313-mysql-xdist-coverage + # python: '3.13' + # allow_failure: false - # pypy3: not included with coverage reports (much slower then). - - name: pypy3-dj42-postgres - python: 'pypy3.9' - allow_failure: false + # # pypy3: not included with coverage reports (much slower then). + # - name: pypy3-dj42-postgres + # python: 'pypy3.9' + # allow_failure: false steps: - uses: actions/checkout@v4 with: From f33ffd9c434f7af8974eaab87e3d0e34384056b2 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 09:43:25 -0400 Subject: [PATCH 39/90] . --- .github/workflows/main.yml | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b1ab294..c7595149 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,8 +97,8 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install tox==4.26.0 + python -m pip install uv + uv tool install tox==4.26.0 --with tox-uv - name: Run tox run: tox -e ${{ matrix.name }} diff --git a/tox.ini b/tox.ini index 410daf2d..336fcd55 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ envlist = extras = testing deps = djmain: https://github.com/django/django/archive/main.tar.gz - dj52: Django>=5.2a1,<6.0 + dj52: Django>=5.2,<6.0 dj51: Django>=5.1,<5.2 dj50: Django>=5.0,<5.1 dj42: Django>=4.2,<4.3 From f6fe9cbce9608ca0b24c404a33ce55cc0261032e Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 09:49:26 -0400 Subject: [PATCH 40/90] . --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 336fcd55..a6af5a77 100644 --- a/tox.ini +++ b/tox.ini @@ -26,10 +26,11 @@ deps = xdist: pytest-xdist>=1.15 setenv = - mysql: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql + mysql: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_mysql postgres: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_postgres sqlite: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite sqlite_file: DJANGO_SETTINGS_MODULE=pytest_django_test.settings_sqlite_file + xdist: PYTEST_ADDOPTS=-n auto coverage: PYTESTDJANGO_TEST_RUNNER=coverage run -m pytest coverage: COVERAGE_PROCESS_START={toxinidir}/pyproject.toml From 81c2e36325bf6436ce6680cc3f7b48aa8278003b Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 09:56:04 -0400 Subject: [PATCH 41/90] Add pytest import skip for xdist in test_fixtures.py to ensure compatibility --- tests/test_fixtures.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 709ae6c9..a8c3d6ce 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -444,6 +444,7 @@ def test_set_non_existent(settings): class TestLiveServer: def test_settings_before(self) -> None: + pytest.importorskip("xdist") from django.conf import settings assert ( @@ -460,6 +461,7 @@ def test_change_settings(self, live_server, settings) -> None: def test_settings_restored(self) -> None: """Ensure that settings are restored after test_settings_before.""" + pytest.importorskip("xdist") from django.conf import settings assert TestLiveServer._test_settings_before_run is True # type: ignore[attr-defined] From 447de77ccca5f69a24d05905991fb46d34859c9a Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 10:03:38 -0400 Subject: [PATCH 42/90] . --- tests/test_fixtures.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index a8c3d6ce..4fadcde2 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -4,6 +4,7 @@ fixtures are tested in test_database. """ +import os import socket from collections.abc import Generator from contextlib import contextmanager @@ -443,8 +444,8 @@ def test_set_non_existent(settings): class TestLiveServer: + @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use") def test_settings_before(self) -> None: - pytest.importorskip("xdist") from django.conf import settings assert ( @@ -459,9 +460,9 @@ def test_url(self, live_server) -> None: def test_change_settings(self, live_server, settings) -> None: assert live_server.url == force_str(live_server) + @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use") def test_settings_restored(self) -> None: """Ensure that settings are restored after test_settings_before.""" - pytest.importorskip("xdist") from django.conf import settings assert TestLiveServer._test_settings_before_run is True # type: ignore[attr-defined] From 5c748762307286eb04875bd7516f875ffca0f461 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 10:13:21 -0400 Subject: [PATCH 43/90] . --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index a6af5a77..34e2475f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - py313-dj{main,52,51}-postgres - py312-dj{main,52,51,42}-postgres - py311-dj{main,52,51,42}-postgres - py310-dj{main,52,51,42}-postgres - py39-dj42-postgres + py313-dj{main,52,51} + py312-dj{main,52,51,42} + py311-dj{main,52,51,42} + py310-dj{main,52,51,42} + py39-dj42 linting [testenv] From 17fc9c07c1c6f4df8c83870e1ec0fcbb59d15620 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 10:30:44 -0400 Subject: [PATCH 44/90] All these tests now run in 68s... damn! --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 34e2475f..1dd8e9d5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - py313-dj{main,52,51} - py312-dj{main,52,51,42} - py311-dj{main,52,51,42} - py310-dj{main,52,51,42} - py39-dj42 + py313-dj{main,52,51}-sqlite-xdist + py312-dj{main,52,51,42}-sqlite-xdist + py311-dj{52,51,42}-sqlite-xdist + py310-dj{52,51,42}-sqlite-xdist + py39-dj42-sqlite-xdist linting [testenv] From ec939d5c00c4f07046b211e48fc79c62a5dbdd3a Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 10:54:59 -0400 Subject: [PATCH 45/90] . --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 1dd8e9d5..b6e41ff1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - py313-dj{main,52,51}-sqlite-xdist - py312-dj{main,52,51,42}-sqlite-xdist - py311-dj{52,51,42}-sqlite-xdist - py310-dj{52,51,42}-sqlite-xdist - py39-dj42-sqlite-xdist + py313-dj{main,52,51}-{sqlite,postgres,mysql}-xdist-coverage + py312-dj{main,52,51,42}-{sqlite,postgres,mysql}-xdist-coverage + py311-dj{52,51,42}-{sqlite,postgres,mysql}-xdist-coverage + py310-dj{52,51,42}-{sqlite,postgres,mysql}-xdist-coverage + py39-dj42-{sqlite,postgres,mysql}-xdist-coverage linting [testenv] From bbe8909d3d0bc9eea9925639cb60ddc9081ade74 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 10:59:39 -0400 Subject: [PATCH 46/90] Refactor tox commands in tox.ini and update workflow to use the -f flag for improved functionality. --- .github/workflows/main.yml | 3 ++- tox.ini | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7595149..e6d2b5b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,7 +101,8 @@ jobs: uv tool install tox==4.26.0 --with tox-uv - name: Run tox - run: tox -e ${{ matrix.name }} + run: | + tox -f ${{ matrix.name }} - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') diff --git a/tox.ini b/tox.ini index b6e41ff1..7d8ab4db 100644 --- a/tox.ini +++ b/tox.ini @@ -40,9 +40,7 @@ setenv = passenv = PYTEST_ADDOPTS,TERM,TEST_DB_USER,TEST_DB_PASSWORD,TEST_DB_HOST usedevelop = True commands = - coverage: coverage erase {env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests} - coverage: coverage combine [testenv:linting] extras = From 18abc2b15e9aa4d07bc9b47856f04f01fd707004 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 11:03:27 -0400 Subject: [PATCH 47/90] . --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6d2b5b2..3a0d4a14 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,20 +101,22 @@ jobs: uv tool install tox==4.26.0 --with tox-uv - name: Run tox + shell: bash run: | - tox -f ${{ matrix.name }} - - - name: Prepare coverage file for upload - if: contains(matrix.name, 'coverage') - run: mv .coverage coverage.${{ matrix.name }} + if [[ ${{ matrix.name }} == *","* ]]; then + tox -e ${{ matrix.name }} + else + tox -f ${{ matrix.name }} + fi - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') uses: actions/upload-artifact@v4 with: name: coverage-artifact-${{ matrix.name }} - path: coverage.${{ matrix.name }} + path: .coverage.* retention-days: 1 + include-hidden-files: true report-coverage: name: Report Combined Coverage From 9226882d07685c6875a2c07f7fb2cc680bc82f76 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 12:29:31 -0400 Subject: [PATCH 48/90] . --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a0d4a14..e98e775e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,7 +147,7 @@ jobs: - name: Combine coverage reports run: | mkdir combined_coverage_data - find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \; + find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; coverage combine combined_coverage_data/* coverage xml coverage html From 99ffdc4a3d799471547f844b35d2905279eff563 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 12:36:57 -0400 Subject: [PATCH 49/90] simpler... --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e98e775e..15da489a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -146,9 +146,7 @@ jobs: - name: Combine coverage reports run: | - mkdir combined_coverage_data - find downloaded-coverage-artifacts -type f -name '.coverage.*' -exec cp {} combined_coverage_data/ \; - coverage combine combined_coverage_data/* + coverage combine coverage xml coverage html coverage report --format=markdown >> $GITHUB_STEP_SUMMARY From 7e0c82bc7d9b0258fa87d82f61d26d2c7b5c0cb8 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 12:42:47 -0400 Subject: [PATCH 50/90] . --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15da489a..f154f3d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -146,6 +146,7 @@ jobs: - name: Combine coverage reports run: | + ls -lash coverage combine coverage xml coverage html From 94af1289277214e3f740da234d3b0adf3978b351 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 12:49:44 -0400 Subject: [PATCH 51/90] . --- .github/workflows/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f154f3d5..2c2a029d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,26 +32,32 @@ jobs: - name: linting,docs python: '3.13' allow_failure: false + use_factor: False - name: py313-sqlite-xdist-coverage python: '3.13' allow_failure: false + use_factor: True - name: py312-sqlite-xdist-coverage python: '3.12' allow_failure: false + use_factor: True - name: py311-sqlite-xdist-coverage python: '3.11' allow_failure: false + use_factor: True - name: py310-sqlite-xdist-coverage python: '3.10' allow_failure: false + use_factor: True - name: py39-sqlite-xdist-coverage python: '3.9' allow_failure: false + use_factor: True # - name: py313-sqlite-coverage # python: '3.13' @@ -101,13 +107,7 @@ jobs: uv tool install tox==4.26.0 --with tox-uv - name: Run tox - shell: bash - run: | - if [[ ${{ matrix.name }} == *","* ]]; then - tox -e ${{ matrix.name }} - else - tox -f ${{ matrix.name }} - fi + run: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }} - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') @@ -146,8 +146,8 @@ jobs: - name: Combine coverage reports run: | - ls -lash - coverage combine + ls -lash downloaded-coverage-artifacts + coverage combine downloaded-coverage-artifacts coverage xml coverage html coverage report --format=markdown >> $GITHUB_STEP_SUMMARY From 2506c026cef67ed53d370b2ee2440016d99fba5e Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 14:48:58 -0400 Subject: [PATCH 52/90] . --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c2a029d..c8cb5446 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -141,13 +141,13 @@ jobs: - name: Download all coverage artifacts uses: actions/download-artifact@v4 with: - path: downloaded-coverage-artifacts + path: . pattern: coverage-artifact-* - name: Combine coverage reports run: | - ls -lash downloaded-coverage-artifacts - coverage combine downloaded-coverage-artifacts + ls -lash coverage-artifact-* + coverage combine coverage-artifact-* coverage xml coverage html coverage report --format=markdown >> $GITHUB_STEP_SUMMARY From 980a1ab895f68587a51c5002fc24feb2228c4f56 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 14:59:43 -0400 Subject: [PATCH 53/90] . --- pyproject.toml | 2 +- tox.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2247e90e..bc5ca806 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ ignore_missing_imports = true [tool.coverage.run] parallel = true -source = ["${PYTESTDJANGO_COVERAGE_SRC}."] +source = ["pytest_django"] branch = true [tool.coverage.report] include = [ diff --git a/tox.ini b/tox.ini index 7d8ab4db..33a4b333 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,6 @@ setenv = coverage: PYTESTDJANGO_TEST_RUNNER=coverage run -m pytest coverage: COVERAGE_PROCESS_START={toxinidir}/pyproject.toml coverage: COVERAGE_FILE={toxinidir}/.coverage - coverage: PYTESTDJANGO_COVERAGE_SRC={toxinidir}/ passenv = PYTEST_ADDOPTS,TERM,TEST_DB_USER,TEST_DB_PASSWORD,TEST_DB_HOST usedevelop = True From 8f26903b58e0ee7f7fad3aee9e8e7bf870081fbe Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 14:59:58 -0400 Subject: [PATCH 54/90] . --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8cb5446..472abc9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -146,7 +146,6 @@ jobs: - name: Combine coverage reports run: | - ls -lash coverage-artifact-* coverage combine coverage-artifact-* coverage xml coverage html From 291e5414e2ab7941970c99bcbede48e7bedf7bb3 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:12:18 -0400 Subject: [PATCH 55/90] more... --- .github/workflows/main.yml | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 472abc9e..07de829b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,26 +59,21 @@ jobs: allow_failure: false use_factor: True - # - name: py313-sqlite-coverage - # python: '3.13' - # allow_failure: true - - # - name: py313-dj52-sqlite-coverage - # python: '3.13' - # allow_failure: true - - # - name: py312-dj51-sqlite-xdist-coverage - # python: '3.12' - # allow_failure: false - - # - name: py313-mysql-xdist-coverage - # python: '3.13' - # allow_failure: false - - # # pypy3: not included with coverage reports (much slower then). - # - name: pypy3-dj42-postgres - # python: 'pypy3.9' - # allow_failure: false + - name: py313-postgres-xdist-coverage + python: '3.13' + allow_failure: false + use_factor: True + + - name: py313-mysql-xdist-coverage + python: '3.13' + allow_failure: false + use_factor: True + + # pypy3: not included with coverage reports (much slower then). + - name: pypy3-djmain-sqlite + python: 'pypy3.9' + allow_failure: false + use_factor: False steps: - uses: actions/checkout@v4 with: From 278eb9417001ffc38edcfcbcfe02ba94c0151d72 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:33:17 -0400 Subject: [PATCH 56/90] . --- .github/workflows/main.yml | 2 +- tox.ini | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07de829b..e72bca41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: # pypy3: not included with coverage reports (much slower then). - name: pypy3-djmain-sqlite - python: 'pypy3.9' + python: 'pypy3.11' allow_failure: false use_factor: False steps: diff --git a/tox.ini b/tox.ini index 33a4b333..0db5efd5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - py313-dj{main,52,51}-{sqlite,postgres,mysql}-xdist-coverage - py312-dj{main,52,51,42}-{sqlite,postgres,mysql}-xdist-coverage - py311-dj{52,51,42}-{sqlite,postgres,mysql}-xdist-coverage - py310-dj{52,51,42}-{sqlite,postgres,mysql}-xdist-coverage - py39-dj42-{sqlite,postgres,mysql}-xdist-coverage + py313-dj{main,52,51}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py312-dj{main,52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py}311-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py}310-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py}39-dj42-{sqlite,postgres,mysql}-{xdist}-{coverage} linting [testenv] From d5ca2d0d5d2cfba280e288561aa20a3f786708bc Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:36:18 -0400 Subject: [PATCH 57/90] . --- .github/workflows/main.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e72bca41..c004502f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,48 +32,53 @@ jobs: - name: linting,docs python: '3.13' allow_failure: false - use_factor: False + use_factor: true - name: py313-sqlite-xdist-coverage python: '3.13' allow_failure: false - use_factor: True + use_factor: true - name: py312-sqlite-xdist-coverage python: '3.12' allow_failure: false - use_factor: True + use_factor: true - name: py311-sqlite-xdist-coverage python: '3.11' allow_failure: false - use_factor: True + use_factor: true - name: py310-sqlite-xdist-coverage python: '3.10' allow_failure: false - use_factor: True + use_factor: true - name: py39-sqlite-xdist-coverage python: '3.9' allow_failure: false - use_factor: True + use_factor: true - - name: py313-postgres-xdist-coverage + - name: py313-djmain-postgres-coverage python: '3.13' allow_failure: false - use_factor: True + use_factor: false - - name: py313-mysql-xdist-coverage + - name: py313-djmain-mysql-coverage python: '3.13' allow_failure: false - use_factor: True + use_factor: false + + - name: py313-djmain-sqlite-pytestmin + python: '3.13' + allow_failure: false + use_factor: false # pypy3: not included with coverage reports (much slower then). - name: pypy3-djmain-sqlite python: 'pypy3.11' allow_failure: false - use_factor: False + use_factor: false steps: - uses: actions/checkout@v4 with: From 7aeb0a492c6b76b82655c48c6e9e5f72cf130935 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:42:05 -0400 Subject: [PATCH 58/90] . --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c004502f..31f278ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,6 +106,12 @@ jobs: python -m pip install uv uv tool install tox==4.26.0 --with tox-uv + - name: Debug tox command + run: | + echo "matrix.use_factor is: ${{ matrix.use_factor }}" + echo "Calculated tox command part: ${{ matrix.use_factor && '-f' || '-e' }}" + echo "Full tox command: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }}" + - name: Run tox run: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }} From e1aabb37c02bd76212559e77967ff9a5d04b134e Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:43:15 -0400 Subject: [PATCH 59/90] . --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31f278ec..618699c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: - name: linting,docs python: '3.13' allow_failure: false - use_factor: true + use_factor: false - name: py313-sqlite-xdist-coverage python: '3.13' From 3768ab8b19cc635c56a71a55b7841b10ecb16d28 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:52:02 -0400 Subject: [PATCH 60/90] . --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 0db5efd5..85caf353 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,9 @@ envlist = py313-dj{main,52,51}-{sqlite,postgres,mysql}-{xdist}-{coverage} py312-dj{main,52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} - py{py}311-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} - py{py}310-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} - py{py}39-dj42-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py,}311-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py,}310-dj{52,51,42}-{sqlite,postgres,mysql}-{xdist}-{coverage} + py{py,}39-dj42-{sqlite,postgres,mysql}-{xdist}-{coverage} linting [testenv] From e7201f9c50b40ea4a2eebccee553d7fbc4a723af Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 15:55:23 -0400 Subject: [PATCH 61/90] . --- .github/workflows/main.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 618699c5..15e590b5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,7 +75,7 @@ jobs: use_factor: false # pypy3: not included with coverage reports (much slower then). - - name: pypy3-djmain-sqlite + - name: pypy3-dj52-sqlite python: 'pypy3.11' allow_failure: false use_factor: false diff --git a/tox.ini b/tox.ini index 85caf353..5811a9ba 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ deps = dj50: Django>=5.0,<5.1 dj42: Django>=4.2,<4.3 - mysql: mysqlclient==2.1.0 + mysql: mysqlclient==2.2.7 postgres: psycopg[binary] coverage: coverage[toml] From c7c0d9f00b679aa2ea012d9e5baf86901045b761 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 16:19:36 -0400 Subject: [PATCH 62/90] . --- .github/workflows/main.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15e590b5..4d3d90d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,10 +39,27 @@ jobs: allow_failure: false use_factor: true - - name: py312-sqlite-xdist-coverage + # start:Speeding up tests by running them in parallel. + - name: py312-djmain-sqlite-xdist-coverage python: '3.12' allow_failure: false - use_factor: true + use_factor: false + + - name: py312-dj52-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj51-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj42-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + # end: Speeding up tests by running them in parallel. - name: py311-sqlite-xdist-coverage python: '3.11' From 2b040cb68f753c8611ded2757e6185f412e3ad9b Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Tue, 27 May 2025 16:27:31 -0400 Subject: [PATCH 63/90] . --- .github/workflows/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d3d90d5..81366166 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -123,12 +123,6 @@ jobs: python -m pip install uv uv tool install tox==4.26.0 --with tox-uv - - name: Debug tox command - run: | - echo "matrix.use_factor is: ${{ matrix.use_factor }}" - echo "Calculated tox command part: ${{ matrix.use_factor && '-f' || '-e' }}" - echo "Full tox command: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }}" - - name: Run tox run: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }} From 9bcbcd8b3abc20aef1777f8cda9d266e9d38fac0 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 3 Jun 2025 03:52:14 -0400 Subject: [PATCH 64/90] . --- .github/workflows/main.yml | 83 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a2258739..d45aa299 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,48 @@ jobs: timeout-minutes: 15 permissions: contents: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Setup mysql + if: contains(matrix.name, 'mysql') + run: | + sudo systemctl start mysql.service + echo "TEST_DB_USER=root" >> $GITHUB_ENV + echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV + + - name: Setup postgresql + if: contains(matrix.name, 'postgres') + run: | + sudo systemctl start postgresql.service + sudo -u postgres createuser --createdb $USER + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox==4.26.0 + + - name: Run tox + run: tox -e ${{ matrix.name }} + + - name: Prepare coverage file for upload + if: contains(matrix.name, 'coverage') + run: mv .coverage coverage.${{ matrix.name }} + + - name: Upload temporary coverage artifact + if: contains(matrix.name, 'coverage') + uses: actions/upload-artifact@v4 + with: + name: coverage-artifact-${{ matrix.name }} + path: coverage.${{ matrix.name }} + retention-days: 1 + strategy: fail-fast: false matrix: @@ -102,47 +144,6 @@ jobs: - name: pypy3-dj42-postgres python: 'pypy3.9' allow_failure: false - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Setup mysql - if: contains(matrix.name, 'mysql') - run: | - sudo systemctl start mysql.service - echo "TEST_DB_USER=root" >> $GITHUB_ENV - echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV - - - name: Setup postgresql - if: contains(matrix.name, 'postgres') - run: | - sudo systemctl start postgresql.service - sudo -u postgres createuser --createdb $USER - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==4.26.0 - - - name: Run tox - run: tox -e ${{ matrix.name }} - - - name: Prepare coverage file for upload - if: contains(matrix.name, 'coverage') - run: mv .coverage coverage.${{ matrix.name }} - - - name: Upload temporary coverage artifact - if: contains(matrix.name, 'coverage') - uses: actions/upload-artifact@v4 - with: - name: coverage-artifact-${{ matrix.name }} - path: coverage.${{ matrix.name }} - retention-days: 1 report-coverage: name: Report Combined Coverage From 3f519be94c0f03b7e73f6983f0e479429b5414f6 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 3 Jun 2025 03:54:26 -0400 Subject: [PATCH 65/90] . --- .github/workflows/main.yml | 146 ++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d45aa299..fd2efa80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,79 +71,79 @@ jobs: fail-fast: false matrix: include: - - name: linting,docs - python: '3.13' - allow_failure: false - - # Explicitly test min pytest. - - name: py313-dj52-sqlite-pytestmin-coverage - python: '3.13' - allow_failure: false - - - name: py313-dj52-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py313-dj51-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py312-dj42-postgres-xdist-coverage - python: '3.12' - allow_failure: false - - - name: py311-dj50-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py311-dj42-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py310-dj52-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj51-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj42-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py311-dj51-mysql-coverage - python: '3.11' - allow_failure: false - - - name: py310-dj42-mysql-coverage - python: '3.10' - allow_failure: false - - - name: py39-dj42-mysql-xdist-coverage - python: '3.9' - allow_failure: false - - - name: py313-djmain-sqlite-coverage - python: '3.13' - allow_failure: true - - - name: py313-dj52-sqlite-coverage - python: '3.13' - allow_failure: true - - - name: py312-dj51-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - - - name: py311-dj42-sqlite-xdist-coverage - python: '3.11' - allow_failure: false - - # pypy3: not included with coverage reports (much slower then). - - name: pypy3-dj42-postgres - python: 'pypy3.9' - allow_failure: false + - name: linting,docs + python: '3.13' + allow_failure: false + + # Explicitly test min pytest. + - name: py313-dj52-sqlite-pytestmin-coverage + python: '3.13' + allow_failure: false + + - name: py313-dj52-postgres-xdist-coverage + python: '3.13' + allow_failure: false + + - name: py313-dj51-postgres-xdist-coverage + python: '3.13' + allow_failure: false + + - name: py312-dj42-postgres-xdist-coverage + python: '3.12' + allow_failure: false + + - name: py311-dj50-postgres-xdist-coverage + python: '3.11' + allow_failure: false + + - name: py311-dj42-postgres-xdist-coverage + python: '3.11' + allow_failure: false + + - name: py310-dj52-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py310-dj51-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py310-dj42-postgres-xdist-coverage + python: '3.10' + allow_failure: false + + - name: py311-dj51-mysql-coverage + python: '3.11' + allow_failure: false + + - name: py310-dj42-mysql-coverage + python: '3.10' + allow_failure: false + + - name: py39-dj42-mysql-xdist-coverage + python: '3.9' + allow_failure: false + + - name: py313-djmain-sqlite-coverage + python: '3.13' + allow_failure: true + + - name: py313-dj52-sqlite-coverage + python: '3.13' + allow_failure: true + + - name: py312-dj51-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + + - name: py311-dj42-sqlite-xdist-coverage + python: '3.11' + allow_failure: false + + # pypy3: not included with coverage reports (much slower then). + - name: pypy3-dj42-postgres + python: 'pypy3.9' + allow_failure: false report-coverage: name: Report Combined Coverage From 78e77c688ee0d24ac3cfd7922ab00ecaa37256e6 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 3 Jun 2025 06:09:16 -0400 Subject: [PATCH 66/90] zizmor changes --- .github/workflows/main.yml | 10 ++++++---- .github/zizmor.yml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6147c438..2a6f29af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,8 @@ jobs: timeout-minutes: 15 permissions: contents: read + env: + MATRIX_NAME: ${{ matrix.name }} steps: - uses: actions/checkout@v4 with: @@ -54,12 +56,10 @@ jobs: - name: Run tox run: tox -e "${MATRIX_NAME}" - env: - MATRIX_NAME: ${{ matrix.name }} - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') - run: mv .coverage coverage.${{ matrix.name }} + run: mv .coverage coverage.${MATRIX_NAME} - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') @@ -185,11 +185,13 @@ jobs: - name: Determine retention days id: determine-retention-days run: | - if [ "${{ github.ref }}" = "refs/heads/main" ] || [[ "${{ github.ref }}" == refs/tags/* ]]; then + if [ "${GITHUB_REF}" = "refs/heads/main" ] || [[ "${GITHUB_REF}" == refs/tags/* ]]; then echo "retention_days=90" >> $GITHUB_OUTPUT else echo "retention_days=3" >> $GITHUB_OUTPUT fi + env: + GITHUB_REF: ${{ github.ref }} - name: Upload combined .coverage file uses: actions/upload-artifact@v4 diff --git a/.github/zizmor.yml b/.github/zizmor.yml index 2ed61128..1a2520ac 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -4,3 +4,4 @@ rules: policies: actions/*: ref-pin codecov/codecov-action: ref-pin + geekyeggo/delete-artifact: ref-pin From f8f4e3f08467655019c391d791426ab47a07dcb7 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 3 Jun 2025 12:14:31 +0200 Subject: [PATCH 67/90] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a6f29af..90c85ba6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -180,7 +180,7 @@ jobs: coverage combine combined_coverage_data/* coverage xml coverage html - coverage report --format=markdown >> $GITHUB_STEP_SUMMARY + coverage report --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY - name: Determine retention days id: determine-retention-days From e18821090c2f1c946268d7acac73b40e897f412e Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Tue, 3 Jun 2025 13:45:23 +0200 Subject: [PATCH 68/90] Update pyproject.toml --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 79632eb6..dc93b5b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,8 +118,6 @@ branch = true [tool.coverage.report] include = [ "pytest_django/*", - "pytest_django_test/*", - "tests/*", ] omit = [ "pytest_django/_version.py", From dfbc2ebac5443110d9f0e1ee338e0fd11b0adb0f Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 07:28:06 +0200 Subject: [PATCH 69/90] Update .github/zizmor.yml --- .github/zizmor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/zizmor.yml b/.github/zizmor.yml index 1a2520ac..2ed61128 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -4,4 +4,3 @@ rules: policies: actions/*: ref-pin codecov/codecov-action: ref-pin - geekyeggo/delete-artifact: ref-pin From 3faf64b51f9b3fbc0b8b1a2da58bc9597bb3f3ad Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 07:31:09 +0200 Subject: [PATCH 70/90] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90c85ba6..cc796b00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -209,7 +209,7 @@ jobs: retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - name: Delete temporary coverage artifacts from run - uses: geekyeggo/delete-artifact@v5 + uses: geekyeggo/delete-artifact@f275313 # 5.1.0 with: name: coverage-artifact-* From 6e8b318bd7c16b196ea7a12faf84051a61fa38f9 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 07:36:48 +0200 Subject: [PATCH 71/90] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc796b00..e7893e11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -209,7 +209,7 @@ jobs: retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - name: Delete temporary coverage artifacts from run - uses: geekyeggo/delete-artifact@f275313 # 5.1.0 + uses: geekyeggo/delete-artifact@ f275313e70c08f6120db482d7a6b98377786765b # 5.1.0 with: name: coverage-artifact-* From 9958235943f8bef04214243e3682fc2016780043 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 07:37:28 +0200 Subject: [PATCH 72/90] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7893e11..e12ecb98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -209,7 +209,7 @@ jobs: retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - name: Delete temporary coverage artifacts from run - uses: geekyeggo/delete-artifact@ f275313e70c08f6120db482d7a6b98377786765b # 5.1.0 + uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # 5.1.0 with: name: coverage-artifact-* From 595b61eb55ac59d26ce370397f1f7326284f2922 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:40:36 -0400 Subject: [PATCH 73/90] Update pyproject.toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index dc93b5b1..79632eb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,6 +118,8 @@ branch = true [tool.coverage.report] include = [ "pytest_django/*", + "pytest_django_test/*", + "tests/*", ] omit = [ "pytest_django/_version.py", From c0c749468824d1bed804631ae893c92dcaad468e Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:44:07 -0400 Subject: [PATCH 74/90] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 79632eb6..33559ed6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,7 +122,7 @@ include = [ "tests/*", ] omit = [ - "pytest_django/_version.py", + "pytest_django/_version.py", # coverage fails when the file stops existing randomly, see .gitnore ] skip_covered = true exclude_lines = [ From f9004d38d7fa97acdb74713c77b3f83d6d262299 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:44:42 -0400 Subject: [PATCH 75/90] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 33559ed6..29acbf43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,7 +122,7 @@ include = [ "tests/*", ] omit = [ - "pytest_django/_version.py", # coverage fails when the file stops existing randomly, see .gitnore + "pytest_django/_version.py", # coverage fails when the file stops existing randomly, see .gitignore ] skip_covered = true exclude_lines = [ From 7eb83caf771efa9219b6b933318284efe7a99bba Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:46:15 -0400 Subject: [PATCH 76/90] Update .github/workflows/main.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff1f4f01..c0a6fdba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: permissions: contents: read env: - MATRIX_NAME: ${{ matrix.name }} + TOXENV: ${{ matrix.name }} steps: - uses: actions/checkout@v4 with: From 764ae23ef9453cbf9adeadea0809f0dc843a3aa1 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:46:46 -0400 Subject: [PATCH 77/90] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0a6fdba..77c5204f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: pip install tox==4.26.0 - name: Run tox - run: tox -e "${MATRIX_NAME}" + run: tox - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') From 1b90774df7c2b1fa1dc71e25a03bcc8774a67dd2 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 4 Jun 2025 08:50:55 -0400 Subject: [PATCH 78/90] Update .github/workflows/main.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77c5204f..8268c3ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: - name: Prepare coverage file for upload if: contains(matrix.name, 'coverage') - run: mv .coverage coverage.${MATRIX_NAME} + run: mv .coverage coverage.${TOXENV} - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') From 36344acff4cca14780b610b4007cec418b6b332e Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Thu, 5 Jun 2025 17:00:29 -0400 Subject: [PATCH 79/90] Update main.yml --- .github/workflows/main.yml | 140 ++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 73 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ad3f9d8..ab173dcd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,79 +82,73 @@ jobs: fail-fast: false matrix: include: - - name: linting,docs - python: '3.13' - allow_failure: false - - # Explicitly test min pytest. - - name: py313-dj52-sqlite-pytestmin-coverage - python: '3.13' - allow_failure: false - - - name: py313-dj52-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py313-dj51-postgres-xdist-coverage - python: '3.13' - allow_failure: false - - - name: py312-dj42-postgres-xdist-coverage - python: '3.12' - allow_failure: false - - - name: py311-dj50-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py311-dj42-postgres-xdist-coverage - python: '3.11' - allow_failure: false - - - name: py310-dj52-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj51-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py310-dj42-postgres-xdist-coverage - python: '3.10' - allow_failure: false - - - name: py311-dj51-mysql-coverage - python: '3.11' - allow_failure: false - - - name: py310-dj42-mysql-coverage - python: '3.10' - allow_failure: false - - - name: py39-dj42-mysql-xdist-coverage - python: '3.9' - allow_failure: false - - - name: py313-djmain-sqlite-coverage - python: '3.13' - allow_failure: true - - - name: py313-dj52-sqlite-coverage - python: '3.13' - allow_failure: true - - - name: py312-dj51-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - - - name: py311-dj42-sqlite-xdist-coverage - python: '3.11' - allow_failure: false - - # pypy3: not included with coverage reports (much slower then). - - name: pypy3-dj42-postgres - python: 'pypy3.9' - allow_failure: false + - name: linting,docs + python: '3.13' + allow_failure: false + use_factor: false + + - name: py313-sqlite-xdist-coverage + python: '3.13' + allow_failure: false + use_factor: true + + # start:Speeding up tests by running them in parallel. + - name: py312-djmain-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj52-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj51-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj42-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + # end: Speeding up tests by running them in parallel. + + - name: py311-sqlite-xdist-coverage + python: '3.11' + allow_failure: false + use_factor: true + + - name: py310-sqlite-xdist-coverage + python: '3.10' + allow_failure: false + use_factor: true + + - name: py39-sqlite-xdist-coverage + python: '3.9' + allow_failure: false + use_factor: true + + - name: py313-djmain-postgres-coverage + python: '3.13' + allow_failure: false + use_factor: false + + - name: py313-djmain-mysql-coverage + python: '3.13' + allow_failure: false + use_factor: false + + - name: py313-djmain-sqlite-pytestmin + python: '3.13' + allow_failure: false + use_factor: false + + # pypy3: not included with coverage reports (much slower then). + - name: pypy3-dj52-sqlite + python: 'pypy3.11' + allow_failure: false + use_factor: false report-coverage: name: Report Combined Coverage From 2ed43eb71d74d7d0e5ec207fda1209a4df9d9362 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:19:37 -0400 Subject: [PATCH 80/90] . --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab173dcd..a54aff5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,10 +65,6 @@ jobs: sarif_file: zizmor.sarif category: zizmor - - name: Prepare coverage file for upload - if: contains(matrix.name, 'coverage') - run: mv .coverage coverage.${TOXENV} - - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') uses: actions/upload-artifact@v4 From b5f158d7451ec9c70ae4650430d732957dd3badf Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:30:50 -0400 Subject: [PATCH 81/90] . --- pyproject.toml | 2 +- tox.ini | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e38b07fb..29acbf43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,7 @@ ignore_missing_imports = true [tool.coverage.run] parallel = true -source = ["pytest_django"] +source = ["${PYTESTDJANGO_COVERAGE_SRC}."] branch = true [tool.coverage.report] include = [ diff --git a/tox.ini b/tox.ini index e7598ece..edcb30ab 100644 --- a/tox.ini +++ b/tox.ini @@ -21,12 +21,6 @@ deps = dj50: Django>=5.0,<5.1 dj42: Django>=4.2,<4.3 - mysql: mysqlclient==2.2.7 - - postgres: psycopg[binary] - coverage: coverage[toml] - coverage: coverage-enable-subprocess - pytestmin: pytest>=7.0,<7.1 setenv = @@ -39,6 +33,7 @@ setenv = coverage: PYTESTDJANGO_TEST_RUNNER=coverage run -m pytest coverage: COVERAGE_PROCESS_START={toxinidir}/pyproject.toml coverage: COVERAGE_FILE={toxinidir}/.coverage + coverage: PYTESTDJANGO_COVERAGE_SRC={toxinidir}/ passenv = PYTEST_ADDOPTS,TERM,TEST_DB_USER,TEST_DB_PASSWORD,TEST_DB_HOST usedevelop = True From 84b70cabcc2012f1aacf8d95e9eaa5afc0c06312 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:39:03 -0400 Subject: [PATCH 82/90] . --- .github/workflows/main.yml | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a54aff5b..67069e94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,46 +82,29 @@ jobs: python: '3.13' allow_failure: false use_factor: false - - - name: py313-sqlite-xdist-coverage - python: '3.13' + + - name: py39-sqlite-xdist-coverage + python: '3.9' allow_failure: false use_factor: true - # start:Speeding up tests by running them in parallel. - - name: py312-djmain-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - use_factor: false - - - name: py312-dj52-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - use_factor: false - - - name: py312-dj51-sqlite-xdist-coverage - python: '3.12' - allow_failure: false - use_factor: false - - - name: py312-dj42-sqlite-xdist-coverage - python: '3.12' + - name: py310-sqlite-xdist-coverage + python: '3.10' allow_failure: false - use_factor: false - # end: Speeding up tests by running them in parallel. + use_factor: true - name: py311-sqlite-xdist-coverage python: '3.11' allow_failure: false use_factor: true - - name: py310-sqlite-xdist-coverage - python: '3.10' + - name: py312-sqlite-xdist-coverage + python: '3.12' allow_failure: false use_factor: true - - name: py39-sqlite-xdist-coverage - python: '3.9' + - name: py313-sqlite-xdist-coverage + python: '3.13' allow_failure: false use_factor: true From 903e05df72a728f2b8c35d886d087e7b4d2bc8aa Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:42:43 -0400 Subject: [PATCH 83/90] . --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 29acbf43..3a404215 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ postgres = [ "psycopg[binary]", ] mysql = [ - "mysqlclient==2.1.0", + "mysqlclient==2.2.7", ] xdist = [ "pytest-xdist", From 72dc763b1b9806b33844bcf1afe41115fc990058 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:44:33 -0400 Subject: [PATCH 84/90] . --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67069e94..dc6f4fcb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: uv tool install tox==4.26.0 --with tox-uv - name: Run tox - run: tox + run: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }} - name: Upload zizmor SARIF report into the GitHub repo code scanning if: contains(matrix.name, 'linting') From 43e182035e8ff4bbd9e109d76281f70564c2bb2b Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 17:59:22 -0400 Subject: [PATCH 85/90] . --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc6f4fcb..2b7fa8f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,8 +26,6 @@ jobs: permissions: contents: read security-events: write - env: - TOXENV: ${{ matrix.name }} steps: - uses: actions/checkout@v4 with: @@ -56,7 +54,9 @@ jobs: uv tool install tox==4.26.0 --with tox-uv - name: Run tox - run: tox ${{ matrix.use_factor && '-f' || '-e' }} ${{ matrix.name }} + run: tox ${TOX_ARGS} + env: + TOX_ARGS: ${{ matrix.use_factor && format('-f {0}', matrix.name) || format('-e {0}', matrix.name) }} - name: Upload zizmor SARIF report into the GitHub repo code scanning if: contains(matrix.name, 'linting') From 2c12d04d4ecde72b93d9fd722461861f30beb112 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Thu, 5 Jun 2025 18:09:44 -0400 Subject: [PATCH 86/90] p312 is pretty slow... --- .github/workflows/main.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b7fa8f2..68ecd2b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,10 +98,22 @@ jobs: allow_failure: false use_factor: true - - name: py312-sqlite-xdist-coverage + # start: Speeding up tests by running them in parallel. + - name: py312-dj42-sqlite-xdist-coverage python: '3.12' allow_failure: false - use_factor: true + use_factor: false + + - name: py312-dj51-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + + - name: py312-dj52-sqlite-xdist-coverage + python: '3.12' + allow_failure: false + use_factor: false + # end: Speeding up tests by running them in parallel. - name: py313-sqlite-xdist-coverage python: '3.13' From d61a45d0e64ea68c00bf8de867949c2552d8ce15 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 16 Jun 2025 08:23:36 -0400 Subject: [PATCH 87/90] Update .github/workflows/main.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/main.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a789bc5..bd5c174e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -192,14 +192,19 @@ jobs: - name: Determine retention days id: determine-retention-days - run: | - if [ "${GITHUB_REF}" = "refs/heads/main" ] || [[ "${GITHUB_REF}" == refs/tags/* ]]; then - echo "retention_days=90" >> $GITHUB_OUTPUT - else - echo "retention_days=3" >> $GITHUB_OUTPUT - fi + run: >- + echo "retention_days=${RETENTION_DAYS}" + >> "${GITHUB_OUTPUT}" env: - GITHUB_REF: ${{ github.ref }} + RETENTION_DAYS: >- + ${{ + ( + github.ref_type == 'tag' + && github.ref_name == github.event.repository.default_branch + ) + && 90 + || 3 + }} - name: Upload combined .coverage file uses: actions/upload-artifact@v4 @@ -207,7 +212,6 @@ jobs: name: coverage-file path: .coverage retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - include-hidden-files: true - name: Upload HTML coverage report uses: actions/upload-artifact@v4 From 0054df5aa06cab6af44bcf4dfeff7e26915b2596 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 13 Aug 2025 09:04:24 -0400 Subject: [PATCH 88/90] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 108ad79e..ce2fd3eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,6 +72,7 @@ jobs: - name: Upload temporary coverage artifact if: contains(matrix.name, 'coverage') uses: actions/upload-artifact@v4 + timeout-minutes: 1 with: name: coverage-artifact-${{ matrix.name }} path: coverage.${{ matrix.name }} From aeb6fc34c620ea7a3746579e56d214ec228fdf4a Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 06:16:21 -0400 Subject: [PATCH 89/90] . --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5799576..63bde68e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,8 +82,8 @@ jobs: - name: linting,docs python: '3.13' allow_failure: false - use_factor: false - + use_factor: false + - name: py39-sqlite-xdist-coverage python: '3.9' allow_failure: false From ca9947684a486b637a997d49e02d9a17a1939d17 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Fri, 15 Aug 2025 06:20:47 -0400 Subject: [PATCH 90/90] Minimize changes --- .github/workflows/main.yml | 90 +++----------------------------------- tox.ini | 4 ++ 2 files changed, 10 insertions(+), 84 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63bde68e..51536858 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,15 +65,13 @@ jobs: sarif_file: zizmor.sarif category: zizmor - - name: Upload temporary coverage artifact + - name: Report coverage if: contains(matrix.name, 'coverage') - uses: actions/upload-artifact@v4 - timeout-minutes: 1 + uses: codecov/codecov-action@v5 with: - name: coverage-artifact-${{ matrix.name }} - path: .coverage.* - retention-days: 1 - include-hidden-files: true + fail_ci_if_error: true + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false @@ -142,87 +140,11 @@ jobs: allow_failure: false use_factor: false - report-coverage: - name: Report Combined Coverage - runs-on: ubuntu-24.04 - needs: test - if: always() - permissions: - contents: read - actions: write - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - - name: Install coverage tool - run: python -m pip install coverage[toml] - - - name: Download all coverage artifacts - uses: actions/download-artifact@v4 - with: - path: . - pattern: coverage-artifact-* - - - name: Combine coverage reports - run: | - coverage combine coverage-artifact-* - coverage xml - coverage html - coverage report --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY - - - name: Determine retention days - id: determine-retention-days - run: >- - echo "retention_days=${RETENTION_DAYS}" - >> "${GITHUB_OUTPUT}" - env: - RETENTION_DAYS: >- - ${{ - ( - github.ref_type == 'tag' - && github.ref_name == github.event.repository.default_branch - ) - && 90 - || 3 - }} - - - name: Upload combined .coverage file - uses: actions/upload-artifact@v4 - with: - name: coverage-file - path: .coverage - retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - - - name: Upload HTML coverage report - uses: actions/upload-artifact@v4 - with: - name: coverage-html-report - path: htmlcov - retention-days: ${{ steps.determine-retention-days.outputs.retention_days }} - - - name: Delete temporary coverage artifacts from run - uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # 5.1.0 - with: - name: coverage-artifact-* - - - name: Report coverage to Codecov - uses: codecov/codecov-action@v5 - with: - files: ./coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true - check: # This job does nothing and is only used for the branch protection if: always() needs: - - report-coverage + - test runs-on: ubuntu-24.04 diff --git a/tox.ini b/tox.ini index 8b1329d5..a9b99641 100644 --- a/tox.ini +++ b/tox.ini @@ -38,7 +38,11 @@ setenv = passenv = PYTEST_ADDOPTS,TERM,TEST_DB_USER,TEST_DB_PASSWORD,TEST_DB_HOST usedevelop = True commands = + coverage: coverage erase {env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests} + coverage: coverage combine + coverage: coverage report + coverage: coverage xml [testenv:linting] dependency_groups = linting