-
-
Notifications
You must be signed in to change notification settings - Fork 827
Open
Description
Problem
The Windows CI job in .github/workflows/ci.yml (line 662) runs pytest without --cov:
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --junitxml=test-results.xml
The Linux/macOS jobs use tox, which includes --cov=borg --cov-config=pyproject.toml, so coverage is generated and uploaded to Codecov. The Windows job skips coverage entirely, even though pytest-cov is already installed via scripts/msys2-install-deps.
This means any PR adding Windows-only source code (e.g., platform/windows.pyx) will always fail the codecov/patch check with 0% coverage, regardless of test quality. PR #9389 is currently affected with all CI checks green, tests passing, but Codecov reports "0.00% of diff hit (target 76.47%)".
| CI job | Test runner | Coverage collected? |
|---|---|---|
Linux/macOS (native_tests) |
tox with --cov=borg |
Yes |
Windows (windows_tests) |
pytest directly |
No |
Proposed fix
Add --cov=borg --cov-config=pyproject.toml to the Windows pytest command, matching what tox uses for Linux/macOS:
# before
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --junitxml=test-results.xml
# after
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --junitxml=test-results.xml- pytest-cov is already available — scripts/msys2-install-deps installs mingw-w64-ucrt-x86_64-python-pytest-cov
- The coverage config in pyproject.toml ([tool.coverage.run]) is platform-agnostic and works as-is
- One-line change in .github/workflows/ci.yml
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels