-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix coverage measurement #138
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #138 +/- ##
===========================================
+ Coverage 50.32% 72.93% +22.61%
===========================================
Files 123 98 -25
Lines 7768 5402 -2366
===========================================
+ Hits 3909 3940 +31
+ Misses 3859 1462 -2397
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I'm not sure if this is best strategy but it does appear to fix the issue with the example: |
I think I remember something about ASDF messing with coverage when running # coverage run must be used because the pytest-asdf plugin will interfere
# with proper coverage measurement due to the order pytest loads its
# entry points.
commands =
coverage: coverage run --source=asdf --rcfile={tox_root}/pyproject.toml -m \
pytest \ Is |
This is only relevant to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, not sure why it works but if it does then I won't complain
To make the coverage more accurate you might want to consider configuring |
Also, jwst CI failure expected because of the version conflict and pkg_resources use in stpipe: spacetelescope/stpipe#84
Good idea. Any suggestions for files in |
Really we should be ignoring any of the test files, so |
Also, if you do end-up modifying the I find this handy so that if I browse to an on-going job I can tell if something has already failed in the job because the output will start displaying in red text. This makes it easy to tell if something has gone wrong for long CI jobs. If this is too out of scope I can make it a separate PR. |
The coverage measurement does not appear to be working correctly.
For example, this function:
stdatamodels/src/stdatamodels/asdf_in_fits.py
Line 13 in dc0da6d
is covered by this test:
stdatamodels/tests/test_asdf_in_fits.py
Line 35 in dc0da6d
The test does appear to be running (confirmed locally) and coverage reports run locally outside tox (with a development install of the package) show increased coverage.
However this function does not appear to have coverage in the CI.
https://app.codecov.io/gh/spacetelescope/stdatamodels/blob/master/src/stdatamodels/asdf_in_fits.py
I tested a few of the solutions mentioned here, which describe how pytest will test the installed package yet coverage is measured against the current directory (for our current configuration):
https://stackoverflow.com/questions/58696476/tox-0-coverage
and the 'usedevelop' option appears to improve the coverage measurement.
Checklist
CHANGES.rst
(either inBug Fixes
orChanges to API
)