Open terryaney opened 9 months ago
Now, I'm getting the opposite on a Unit test project. I generated a lcov
format which automatically was named to coverage.info
as expected. The line number highlighting is correct (green for the GetDateForDay
function is only function I wrote tests for), but the status bar says '0% Coverage'.
@terryaney Thanks for the ticket and the logs from the extension output. Definitely seems like an issue with the status % indicator, otherwise it might be coming from cobertura as that upstream library can have issues at times.
We should probably have more logging in this area of the code to assist with debugging your issues, just looking at the source code doesn't reveal anything immediately.
public setCoverage(linePercentage: number | undefined ) {
if (Number.isFinite(linePercentage)) {
this.lineCoverage = `${linePercentage}%`;
} else {
this.lineCoverage = undefined;
}
this.update();
}
Do you know if it is all files within your codebase or just a subset?
Do you know if it is all files within your codebase or just a subset?
Unfortunately, it appears not. I wrote a few unit tests to test extension methods in one project and it seemed to display % correctly, but another few simple extension method tests in another project didn't work (second reference above where I mention the 'opposite was happening with lcov
'). So I have:
coverage.info
but work with lcov
lcov
that does NOT work.lcov
that DOES work.Anyway to turn on meaningful logging I can give you?
Do you know if it is all files within your codebase or just a subset?
Unfortunately, it appears not. I wrote a few unit tests to test extension methods in one project and it seemed to display % correctly, but another few simple extension method tests in another project didn't work (second reference above where I mention the 'opposite was happening with
lcov
'). So I have:1. Integration tests (original post) that do not work with `coverage.info` but work with `lcov` 2. Unit test in library A with `lcov` that does NOT work. 3. Unit test in library B with `lcov` that DOES work.
Anyway to turn on meaningful logging I can give you?
Sadly, no current way to introduce more logging easily (via an extension setting lets say). You would be able to add extra logging by using the existing channel in the compiled extension but that isn't a very fun experience. I can see about adding more logging to the existing channel pattern but it might not be in for next release sadly.
https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/extension.ts#L8-L17
I'll wait :) My VS Code extension experience is close to NIL. Thanks for update.
I'll wait :) My VS Code extension experience is close to NIL. Thanks for update.
No worries, I always like to at least present the option, as sometimes people have expectations for how long a bug might take to fix. We will get to this issue eventually, thanks for using the extension!
If I use
lcov
coverage format, everything seems to work. When usingcobertura
, the status bar percentage is wrong. Here iscobertura
screen shot:Approve.cs
file is in the correct project/folder that tests were ran on and that there is only acoverage.cobertura.xml
file present.If I change the
lcov
format, everything seems to display correctly:Let me know if I can provide any more info. Thanks.