question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get coverage to display

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
spodymcommented, May 9, 2018

@ryanluker You are correct.

The output is based on, and intended to be compatible with, https://github.com/davglass/lcov-parse This is from https://github.com/vokal/cobertura-parse

lcov-parse is taking it’s file attribute from lcov’s SF part (SF:<absolute path to the source file>)

            case 'SF':
                item.file = parts.slice(1).join(':').trim();

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.

0reactions
ryanlukercommented, Jul 1, 2018

@supersonicclay FYI this issue here is semi related to clover.xml #140

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found