Comments (8)
I also have output format like:
mode: set
-proj-/1/2/3/4/5.go:32.99,34.26 2 0
...
... and I don't know what lcov
format is (I cannot find it online or an example file), and idk if the extension can read multiple formats, and whether my files are parsed and "stored internally" correctly or not 😓
from vscode-coverage-gutters.
@stdedos thanks for the issue / question!
The default golang code coverage format is not compatible with one of the support coverage format types, afaik.
https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/files/coveragefile.ts#L3-L6
Looks like you should be able to covert to other formats that are supported though (see below).
https://stackoverflow.com/a/31440740
from vscode-coverage-gutters.
The default golang code coverage format is not compatible with one of the support coverage format types, afaik.
master
/src/files/coveragefile.ts#L3-L6
Could it be that there's a message in the extension log for reading unsupported format and failing? 😕
Here are the last lines of the extension's log:
[1668504730779][coverageservice]: INITIALIZING
[1668505343076][coverageservice]: LOADING
[1668505345080][coverageservice]: Loading 2 file(s)
[1668505345080][coverageservice]: -proj-/test_reports/coverage.txt,-proj-/test_reports/cobertura_report.xml
[1668505345093][coverageservice]: Loaded 2 data file(s)
[1668505362017][coverageservice]: LOADING
[1668505364014][coverageservice]: Loading 2 file(s)
[1668505364014][coverageservice]: -proj-/test_reports/coverage.txt,-proj-/cov.xml
[1668505364019][displayCoverageForActiveFile]: ENOENT: no such file or directory, open '-proj-/cov.xml'
[1668505364019][displayCoverageForActiveFile]: Error: ENOENT: no such file or directory, open '-proj-/cov.xml'
[1668505372660][coverageservice]: LOADING
[1668505375112][coverageservice]: Loading 1 file(s)
[1668505375112][coverageservice]: -proj-/test_reports/coverage.txt
[1668505375115][coverageservice]: Loaded 1 data file(s)
"Does this mean it's working, or not?" 🤔
Looks like you should be able to covert to other formats that are supported though (see below).
stackoverflow.com/a/31440740
I have already the look-alike file:
$ gocover-cobertura < "$COVERAGE_FILE" > "$COBERTURA_REPORT" $ head "$COBERTURA_REPORT" <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd"> <coverage line-rate="0.5702541" branch-rate="0" version="" timestamp="1668431560233" lines-covered="4578" lines-valid="8028" branches-covered="0" branches-valid="0" complexity="0"> <sources> <source>-path-/-proj-/git-submodule</source> <source>-path-/-proj-</source> </sources> <packages> <package name="a/b/git-submodule/d" line-rate="0.50127876" branch-rate="0" complexity="0"> <classes> $
So I don't understand why doesn't work 😕
On a tangent, there is a weird situation that, gocover-cobertura < "$COVERAGE_FILE" > "$COBERTURA_REPORT"
and gocov convert go-code-cover | gocov-xml >| coverage.xml
do not give byte-for-byte similar inputs (but they look comparable, and they reference the same schema <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
) - and hence that re-enforces my question "Does vscode-coverage-gutters
successfully parse that file?".
I do see coverage data for the file that interests me, and for some reason, they are not rendered.
from vscode-coverage-gutters.
Thanks for the extra info, normally the debug logs look like this... so there must be an issue with the source paths in the cobertura report file 🤔.
[1668970981951][coverageservice]: INITIALIZING
[1668970998653][coverageservice]: LOADING
[1668970998732][coverageservice]: Loading 6 file(s)
[1668970998732][coverageservice]: c:\Users\ryanl\dev\vscode-coverage-gutters\example\node\lcov.info,c:\Users\ryanl\dev\vscode-coverage-gutters\example\remote-node\lcov.info,c:\Users\ryanl\dev\vscode-coverage-gutters\example\ruby\lcov.info,c:\Users\ryanl\dev\vscode-coverage-gutters\example\java\my-app\cov.xml,c:\Users\ryanl\dev\vscode-coverage-gutters\example\php\cov.xml,c:\Users\ryanl\dev\vscode-coverage-gutters\example\python\cov.xml
[1668970998735][coverageservice]: Loaded 6 data file(s)
[1668970998759][coverageservice]: Caching 17 coverage(s)
[1668970998759][coverageservice]: READY
[1668970998759][coverageservice]: RENDERING
[1668970998759][renderer][section file path]: ./node/test-coverage.js
[1668970998759][renderer][section file path]: ./node/test-coverage.js
[1668970998760][coverageservice]: READY
[1668970998760][coverageservice]: Listening to file system at {c:\Users\ryanl\dev\vscode-coverage-gutters\example}/**/{lcov.info,cov.xml,coverage.xml,jacoco.xml,coverage.cobertura.xml}
The key output here would be the caching line which signifies that coverages were found in the files and now are stored in memory.
[1668970998759][coverageservice]: Caching 17 coverage(s)
Make sure that you are opening the project / folder from root or where-ever the cobertura file has its root at, or otherwise the extension might not be able to see the files properly.
from vscode-coverage-gutters.
[1668970998759][coverageservice]: Caching 17 coverage(s)
I have managed to see this line "at some point", although I don't remember exactly when.
IMHO, an "Invalid coverage file format" log line would be very worth it. Even if you want to have it on debug/trace level.
Make sure that you are opening the project / folder from root or where-ever the cobertura file has its root at
IIRC, coverage files contain absolute paths 😕
Codium is "normally" opened in project mode for the project we are talking about. Originally, I have opened those projects with codium .
(inside project top-level), but nowadays "I just open Codium" (hot exit takes care of re-opening my stuff). I also have 3 projects opened at the same time
from vscode-coverage-gutters.
[1668970998759][coverageservice]: Caching 17 coverage(s)
I have managed to see this line "at some point", although I don't remember exactly when.
So basically I have:
[1669028337981][coverageservice]: INITIALIZING
[1669028802913][coverageservice]: LOADING
[1669028804923][coverageservice]: Loading 1 file(s)
[1669028804923][coverageservice]: -proj-/test_reports/cobertura_report.xml
[1669028804925][coverageservice]: Loaded 1 data file(s)
[1669028805348][coverageservice]: Caching 141 coverage(s)
[1669028805348][coverageservice]: READY
[1669028805348][coverageservice]: RENDERING
[1669028805356][coverageservice]: READY
... and still rendering does not happen.
I have re-activated Preview manually (via shortcut), soft (Developer: Reload Codium) and hard reloaded Codium. No change.
from vscode-coverage-gutters.
@stdedos Thanks for the additional logs!
I will do a bit of investigation next time I get back to this project, but from what you have posted, it looks like it should be working 🤔.
One other area you could try, is tinkering with these 3 settings that deal with the file matching between the coverages and the actual files you open. https://github.com/ryanluker/vscode-coverage-gutters/blob/master/package.json#L112-L126
from vscode-coverage-gutters.
Closing due to staleness but definitely willing to reopen!
from vscode-coverage-gutters.
Related Issues (20)
- Extension settings do not have the scope property defined HOT 3
- refactoring if clause caused extension to crash HOT 3
- update CHANGELOG.md to make changes extension-visible
- Java example pom issues and failure in mvn install HOT 2
- Cannot seem to watch files outside of VS Code workspace directory HOT 2
- Improve visibility of covered lines HOT 4
- Add support for remote coverage files HOT 3
- Support coverage reports with multiple sources HOT 2
- behavior change suggestion/rfc: statusbar should report `Math.floor` instead of `Math.round` HOT 1
- `Illegal argument: line must be non-negative` when any `detail.line` is 0 HOT 1
- Where does the watcher look for the lcov.info file? HOT 2
- Coverage information fails to render when branch coverage is enabled HOT 1
- Update deploy automation action to use v1 of external action
- Cant read coverage data from cobertura-coverage.xml HOT 1
- Don't highlight tested lines HOT 4
- vsix packaging: drop unused folders HOT 1
- cobertura Status Bar Percentage Wrong with C# Workspace HOT 6
- Attempting to parse cobertura.xml fails after converting from visual studio .coverage binary. HOT 2
- settings: resolve configuration settings HOT 1
- [Documentation] Example Java Gradle Project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-coverage-gutters.