From c4a959ab84201f89ae4d19058b0ef173d9d842f1 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 10 Oct 2025 08:46:33 +0100 Subject: [PATCH 1/2] Fix and simplify coverage config coverage only takes the last --source --- .github/workflows/test.yml | 56 +++++++++++++++----------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 831c05d79..1cb5974e4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,16 +153,12 @@ jobs: - name: Run tests run: | uv run --extra=dev \ - coverage run \ - --parallel-mode \ - --source=src/ \ - --source=tests/ \ - -m pytest \ - -s \ - -vvv \ - --showlocals \ - --exitfirst \ - ${{ matrix.ci_pattern }} + coverage run -m pytest \ + -s \ + -vvv \ + --showlocals \ + --exitfirst \ + ${{ matrix.ci_pattern }} env: UV_PYTHON: ${{ matrix.python-version }} @@ -204,19 +200,15 @@ jobs: - name: Run tests run: | uv run --extra=dev \ - coverage run \ - --parallel-mode \ - --source=src/ \ - --source=tests/ \ - -m pytest \ - --skip-docker_build_tests \ - --skip-docker_in_memory \ - --skip-mock \ - --skip-real \ - --capture=no \ - -vvv \ - --exitfirst \ - . + coverage run -m pytest \ + --skip-docker_build_tests \ + --skip-docker_in_memory \ + --skip-mock \ + --skip-real \ + --capture=no \ + -vvv \ + --exitfirst \ + . env: UV_PYTHON: ${{ matrix.python-version }} @@ -260,16 +252,12 @@ jobs: # # We therefore have a few ``# pragma: no cover`` statements. uv run --extra=dev \ - coverage run \ - --parallel-mode \ - --source=src/ \ - --source=tests/ \ - -m pytest \ - --skip-real \ - -vvv \ - --exitfirst \ - -n auto \ - . + coverage run -m pytest \ + --skip-real \ + -vvv \ + --exitfirst \ + -n auto \ + . env: UV_PYTHON: ${{ matrix.python-version }} @@ -305,7 +293,7 @@ jobs: coverage report --format=markdown >> "$GITHUB_STEP_SUMMARY" # Report again and fail if under 100%. - coverage report --fail-under=100 + coverage report - name: Upload HTML report if check failed uses: actions/upload-artifact@v4 From 75fa85fefd05dba01119e0df0422b1532730e24a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 10 Oct 2025 08:56:45 +0100 Subject: [PATCH 2/2] Use parallel settings --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 128e02c88..013d9bbc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -365,6 +365,8 @@ branch = true omit = [ "src/mock_vws/_flask_server/healthcheck.py", ] +parallel = true +source = [ "src/", "tests/" ] [tool.coverage.report] @@ -372,6 +374,7 @@ exclude_also = [ "if TYPE_CHECKING:", "class .*\\bProtocol\\):", ] +fail_under = 100 [tool.mypy]