Unable to get coverage to display
See original GitHub issueI can’t get coverage-gutters to render the gutters. After having done some tracing, I think the issue is in/around renderer.findIntersect(), as it always return “”.
Information about my setup:
- VS Code: 1.23.0 (OSX 10.13.4)
- Coverage Gutters: 2.0.0
- python: 2.7.14
- python coverage: 4.5.1
- pytest: 3.5.1
- pytest-cov: 2.5.1
- I’m generating cov.xml via
pytest --cov=myprojectname --cov-report=xml:cov.xml
Snippet of cov.xml:
<coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="0.7871" lines-covered="196" lines-valid="249" timestamp="1525805187668" version="4.5.1">
<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/Users/justfalter/code/myprojectname/myprojectname</source>
</sources>
<packages>
<package branch-rate="0" complexity="0" line-rate="0.7871" name=".">
<classes>
<class branch-rate="0" complexity="0" filename="messages.py" line-rate="0.9691" name="messages.py">
<methods/>
<lines>
<line hits="1" number="3"/>
<line hits="1" number="4"/>
<line hits="1" number="5"/>
<line hits="1" number="7"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>
For example, findTopSectionForEditor calls findIntersect(base: editorFile, comparee: sectionFile):
- editorFile:
###users###justfalter###code###myprojectname###myprojectname###messages.py
- sectionFile:
messages.py
subInt ends up being messages.py
, here: https://github.com/ryanluker/vscode-coverage-gutters/blob/f06458d0ae307118fe6ea54e2efa187dc6bc08e7/src/renderer.ts#L140
But the function always seems to return “” here: https://github.com/ryanluker/vscode-coverage-gutters/blob/f06458d0ae307118fe6ea54e2efa187dc6bc08e7/src/renderer.ts#L142-L144
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:21 (16 by maintainers)
Top Results From Across the Web
Troubleshooting Code Coverage - Visual Studio (Windows)
However, in some cases, the Code Coverage Results window displays an error ... There are several reasons why you can get empty results....
Read more >IntelliJ IDEA Test Coverage window doesn't show
Try opening Settings > Build, Execution, Deployment > Coverage and check the "Activate Coverage View" checkbox. After that run another test with ...
Read more >Code coverage generation fails on … | Apple Developer Forums
Hi Everyone, our project has a few vendor libraries that don't support the M1 architecture when building for the simulator, so we have...
Read more >[Coverage] Troubleshooting guide for .NET code coverage ...
The goal of this guide is show how to troubleshoot and … ... Can't Get Code Coverage For Dotnet. SonarQube scanner not retrieving...
Read more >dotCover is not showing Code Coverage – .NET Tools Support
The assemblies you are trying to cover are not present in the coverage report or have 0% coverage. Possible cause. dotCover is unable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ryanluker You are correct.
lcov-parse
is taking it’sfile
attribute from lcov’sSF
part (SF:<absolute path to the source file>
)The clean solution is to update
cobertura-parse
and extend paths to absolute paths. But I also see benefits of adding switch in this project for allowing less strict path matching.Since I recently made small update in
cobertura-parse
I will make PR with absolute paths update later today.@supersonicclay FYI this issue here is semi related to clover.xml #140