Skip to content
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

Ignore conftest.py in code coverage #387

Closed
chuckwondo opened this issue Jan 24, 2025 · 2 comments · Fixed by #388
Closed

Ignore conftest.py in code coverage #387

chuckwondo opened this issue Jan 24, 2025 · 2 comments · Fixed by #388
Labels
CI Continuous Integration

Comments

@chuckwondo
Copy link
Contributor

chuckwondo commented Jan 24, 2025

Currently, .github/codecov.yml ignores virtualizarr/tests, as it should, but it should also ignore the top level conftest.py file. By not ignoring it, we are very slightly inflating our coverage by about 1% (from ~78% to ~79%).

This isn't egregious, but the difference could mean erroneously reaching our target when we actually are not reaching it, thus potentially passing coverage when it should fail.

Further, we should add a .coveragerc file so that users locally running tests will see coverage properly reported as well, with the following contents:

[run]
omit =
    conftest.py
    virtualizarr/tests

This duplicates the information in the "ignore" section in .github/codecov.yml file, but the pytest-cov plugin cannot make use of that file, as it is specific to GitHub workflows. However, it is a very small duplication of information, and is very likely to remain unchanged.

@maxrjones
Copy link
Member

Good idea! I'd be glad to review a PR with these changes.

chuckwondo added a commit to chuckwondo/VirtualiZarr that referenced this issue Jan 24, 2025
In addition, make it easier for produce coverage report locally by
adding pytest config options to pyproject.toml. This also produces
consistent results between local runs and runs in CI, and adds a
term-missing report for human readability, both for local runs as well
as in CI, so it show up in the logs.

Fixes zarr-developers#387
chuckwondo added a commit to chuckwondo/VirtualiZarr that referenced this issue Jan 25, 2025
In addition, make it easier for produce coverage report locally by
adding pytest config options to pyproject.toml. This also produces
consistent results between local runs and runs in CI, and adds a
term-missing report for human readability, both for local runs as well
as in CI, so it show up in the logs.

Fixes zarr-developers#387
@TomNicholas TomNicholas added the CI Continuous Integration label Jan 25, 2025
@chuckwondo
Copy link
Contributor Author

Good idea! I'd be glad to review a PR with these changes.

Thanks @maxrjones. Please see #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants