Fix: Exclude platform-specific code from coverage, fixes #9351#9352
Open
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
Open
Fix: Exclude platform-specific code from coverage, fixes #9351#9352trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9352 +/- ##
==========================================
+ Coverage 76.03% 76.20% +0.17%
==========================================
Files 85 85
Lines 14744 14699 -45
Branches 2194 2191 -3
==========================================
- Hits 11211 11202 -9
+ Misses 2856 2820 -36
Partials 677 677 ☔ View full report in Codecov by Sentry. |
Member
|
Is that the only way to deal with it, by completely excluding these lines everywhere? Actually we have coverage for platform-specific lines, but only on the runner with the respective platform. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses missing coverage reports for platform-specific code (e.g.,
# pragma: win32 only) by explicitly excluding these pragmas inpyproject.toml. Fixes #9351.Previously,
pyproject.tomlonly excludedpragma: freebsd onlyandpragma: unknown platform only. This caused Codecov to report missing coverage for valid platform-specific imports (likeset_birthtimeon Windows) when running on Linux CI.Changes
pyproject.toml: Addedwin32,posix,linux,darwin, andnetbsdpragmas to theexclude_lineslist in coverage configuration.Verification