Skip to content

fix: add --cov flags to Windows CI pytest command, fixes #9418#9419

Open
mr-raj12 wants to merge 3 commits intoborgbackup:masterfrom
mr-raj12:ci-windows-coverage
Open

fix: add --cov flags to Windows CI pytest command, fixes #9418#9419
mr-raj12 wants to merge 3 commits intoborgbackup:masterfrom
mr-raj12:ci-windows-coverage

Conversation

@mr-raj12
Copy link
Contributor

Description

The Windows CI job (windows_tests) was running pytest without --cov, so Codecov received no coverage data from Windows. Any PR touching Windows-only code would fail codecov/patch with 0%.

Added --cov=borg --cov-config=pyproject.toml to the Windows pytest command, matching the flags already used by the Linux/tox-based CI jobs.

Fixes #9418

Checklist

  • PR is against master
  • Tests pass
  • Commit messages are clean and reference related issues

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (0b05b44) to head (cc0ed81).
⚠️ Report is 12 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9419      +/-   ##
==========================================
+ Coverage   76.47%   76.50%   +0.03%     
==========================================
  Files          85       85              
  Lines       14803    14818      +15     
  Branches     2213     2214       +1     
==========================================
+ Hits        11321    11337      +16     
  Misses       2803     2803              
+ Partials      679      678       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

borg.exe -V
. env/bin/activate
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --junitxml=test-results.xml
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --junitxml=test-results.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.

but why does it say the test coverage of the project did change by 0%? shouldn't we see an increase due to this change?

Copy link
Member

@ThomasWaldmann ThomasWaldmann Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@mr-raj12 mr-raj12 Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying few tweaks before final squash and force push

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it looks better for win32.

Comment on lines 685 to 686
files: coverage.xml
flags: windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these needed? the corresponding linux action does not have these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed them in latest push and it just matches the Linux setup , waiting on CI to confirm codecov picks it up

borg.exe -V
. env/bin/activate
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --junitxml=test-results.xml
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --cov-report=xml:coverage.xml --junitxml=test-results.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is --cov-report needed? the linux test run does not have this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: Windows CI does not collect coverage, breaks Codecov patch check for Windows-only code

2 participants