-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(coverage): make coverage consistent and reproducible #1388
base: master
Are you sure you want to change the base?
Conversation
4b4b345
to
3fe1a27
Compare
Codecov Report
@@ Coverage Diff @@
## master #1388 +/- ##
==========================================
+ Coverage 97.27% 97.99% +0.72%
==========================================
Files 48 42 -6
Lines 4327 4285 -42
==========================================
- Hits 4209 4199 -10
+ Misses 118 86 -32
Flags with carried forward coverage won't be shown. Click here to find out more. |
My bad, I have been through multiple iterations to find one working, and I didn't submit the right one. This should be fixed. But honestly, I would simply remove coverage on In the case of #1386 I think this is only a codecov misreport as the file flagged as loosing coverage was in fact already not covered (but this PR should fix its coverage except for the first test and I don't know why) |
3fe1a27
to
04cefd8
Compare
04cefd8
to
26695de
Compare
I tested it and now I get the report I expected. I noticed this generates hundreds of
I think it's useful in the sense that some parts of the test you write could be not really exercised for some reason. Maybe you're missing some parametrization. Keep in mind that codecov is configured to aggregate all reports. Some tests run only on some OS, but we push all of them and then they get summed. Maybe that affects? |
Setting as draft until attended. @noirbizarre do you have plans to complete this? |
OMG, sorry, I completly forgot this one. |
While working on #1386, I noticed unexpected coverage changes on some module. This is the consequence of 2 things:
pytest-cov
should be loaded early to avoid depending on plugins and tests load orderpytest-xdist
without--cov-append
leading to some reports parts being erased/overwrittenThis mean coverage is subject to change with:
For reference:
So this PR:
-p pytest_cov
to ensure pytest-cov is loaded before other pluginspyproject.toml
to ensure consistent parameters whether tests/coverage are running in CI or locally--cov-append
parameter to coverage for betterpytest-xdist
handlingpoe coverage
to ensure developers can run the same test suite locallyNote: test coverage has been kept, but I think codebase coverage should be enough and in this case, classical
pytest
/pytest-cov
should be enough as you don't need to ensure coverage tooling is loaded before everything else.