Skip to content

Add coverage tox target #352

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

Closed

Conversation

gnikonorov
Copy link
Member

@gnikonorov gnikonorov commented Oct 18, 2020

Add a tox target for generating coverage reports. I am doing this so that we can grow our test coverage. When the target is run, we get the following output after the pytest suite finishes:

-------------------------------------------------------------------------- generated html file: file:///home/gnikonorov/pytest-html/.tox/coverage/log/report.html --------------------------------------------------------------------------

----------- coverage: platform linux, python 3.6.9-final-0 -----------
Name                      Stmts   Miss Branch BrPart     Cover   Missing
------------------------------------------------------------------------
pytest_html/__init__.py       7      2      0      0    71.43%   7-9
pytest_html/extras.py        28     11      0      0    60.71%   14, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60
pytest_html/hooks.py          5      0      0      0   100.00%
pytest_html/plugin.py       376    300    136      4    16.02%   33-38, 89->exit, 90->91, 91-92, 93->95, 95-96, 101->102, 102-103, 128-130, 134-135, 140-152, 156-196, 202-211, 216-234, 237-279, 282-320, 325-357, 360-364, 367-371, 374-384, 387-393, 396-406, 409-414, 418-419, 422-585, 588-612, 615-628, 631-683, 689, 692-693, 696, 699-701, 704
------------------------------------------------------------------------
TOTAL                       416    313    136      4    19.75%

The next steps assuming we're all on board would be:

  • Set up codecov for this project
  • Publish the results of this run to codecov
  • Grow our coverage

I used pytest-cov's adhoc-layout example as a starting point

@gnikonorov gnikonorov added skip-changelog Can be missed from the changelog. Infrastructure Changes related to project infrastructure ( CI/CD, deploy mechanism, etc. ) labels Oct 18, 2020
@gnikonorov gnikonorov self-assigned this Oct 18, 2020
Copy link
Contributor

@BeyondEvil BeyondEvil left a comment

Choose a reason for hiding this comment

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

Nice! But given the discussion in #350, I think we should hold off on any work to up the coverage. Better to spend that time and energy on V3 imo.

That way we can set a coverage target from the start and block PR's that puts us under the target.

@gnikonorov
Copy link
Member Author

Nice! But given the discussion in #350, I think we should hold off on any work to up the coverage. Better to spend that time and energy on V3 imo.

That way we can set a coverage target from the start and block PR's that puts us under the target.

I agree! This was just something small to get it going

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

I do not hing that coverage is what we need at this stage for two reasons: upcoming major rework around dropping py and also use of pytest-cov is... controversial. This job does not run on CI so it does not provide much practical value.

Running coverage on CI is tricky as one also needs to collect results from each job and combine them. We should do it but I see it at the bottom of the priority list.

@gnikonorov gnikonorov closed this Oct 19, 2020
@gnikonorov
Copy link
Member Author

I'll close for now then to not clutter the list of open PRs. I'll reopen when we feel ready to add coverage

@gnikonorov gnikonorov deleted the add_coverage_tox_target branch November 12, 2020 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Changes related to project infrastructure ( CI/CD, deploy mechanism, etc. ) skip-changelog Can be missed from the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants