ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Coverage gutters not showing same coverage as coverage report #342

Closed istrupin closed 2 years ago

istrupin commented 3 years ago

Describe the bug I am running PyTest with pytest-cov, and in certain situations, Coverage Gutters is not displaying the same coverage percentage or covered line numbers as my coverage report (both HTML and XML). Coverage Gutters seems to be showing less coverage than what the report shows.

To Reproduce Steps to reproduce the behaviour:

  1. Run pipenv run pytest -m "not integration" --cov-report xml --cov-report html --cov-report term --cov=. tests/ to generate a coverage report (using pipenv for dependency management)
  2. Add a Coverage Gutters watch
  3. Compare covered lines and percentage on watch with HTML report and with XML report

Expected behaviour I would expect the coverage statistics on my coverage reports to match Coverage Gutters

Screenshots

Coverage gutters shows no coverage past line 33: image

Coverage gutters shows 64% coverage: image

XML report shows 76% line coverage with coverage on lines past line 33: image

HTML report showing the same lines having coverage: image

Desktop (please complete the following information):

ryanluker commented 3 years ago

@istrupin Thanks for submitting an issue! Could you try generating the coverage as follows, similar to how the example/python project does? https://github.com/ryanluker/vscode-coverage-gutters/tree/master/example/python

It might also be due to where you are generating the coverage from and where you load the folder from (you can also try the example project to confirm that works fine with your system).

istrupin commented 2 years ago

Hey @ryanluker , sorry it took me so long to get back to this.

I gave this a shot, and it seems to be working correctly now. Perhaps a new update between when I filed this issue and now solved my problem?

ryanluker commented 2 years ago

@istrupin Thanks for getting back to me! Yeah the recent couple of releases could have fixed this 🤔 .