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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test coverage reporting #1517

Merged
merged 4 commits into from Sep 30, 2020
Merged

Conversation

dopplershift
Copy link
Member

@dopplershift dopplershift commented Sep 30, 2020

Description Of Changes

This fixes some issues in our test coverage reporting. In recent versions of pytest, it seems the warning filter is initialized early on. This is a problem for us because that ends up importing metpy.deprecation before pytest-cov has a chance to set up coverage. Thus, currently, metpy, metpy._version, metpy.xarray, metpy.units, and metpy.deprecation aren't included in the coverage--at least any code that executes at import time. 馃槶 This was really annoying to figure out.

Fix this by running coverage manually. As a result, we no longer need to install pytest-cov for CI--it's still fine to use locally (so long as you're not running a warning filter on the MetpyDeprecationWarning).

  • Tweak our GitHub Actions workflows to upload coverage reports with an appropriate name to aid debugging.
  • Fix up some places we lost coverage, as noted in Fix up coverage聽#1318 .

Checklist

@dopplershift dopplershift added Area: DevTools Pertains to tools for developers Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Bug Something is not working like it should labels Sep 30, 2020
@dopplershift dopplershift added this to the 1.0 milestone Sep 30, 2020
pytest-cov ends up invoking coverage *after* the warning filter, which
means coverage starts after many submodules are imported.
Copy link
Member

@dcamron dcamron left a comment

Choose a reason for hiding this comment

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

Took the opportunity for some time to understand coverage.py and how you've set up these workflows. With that, no complaints here!

@dcamron dcamron merged commit 6b966f8 into Unidata:master Sep 30, 2020
@dopplershift dopplershift deleted the fix-coverage branch September 30, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: DevTools Pertains to tools for developers Area: Infrastructure Pertains to project infrastructure (e.g. CI, linting) Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix up coverage
2 participants