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

Only loading one file from clover.xml #234

Closed omihalas closed 4 years ago

omihalas commented 5 years ago

Hello, I think something is wrong cu this clover.xml In this file there are many files but the extension keeps loading only the first file name that it finds. I do not know if this is normal.

[1566978565809][coverageservice]: Loading 1 file(s) [1566978565810][coverageservice]: Loaded 1 data file(s) [1566978565889][coverageservice]: Caching 2 coverage(s)

I have attached the clover.xml cov.zip

I am using vscode on windows and latest version of this extension. What i have noticed that the loaded files are loaded because they are included in package name parent but if there are files without this parent they are ignored

ryanluker commented 5 years ago

@omihalas thanks for submitting an issue! This is probably related to the relative path detection (thus your correct statement around package name being correct). This may be fixed in 2.4.1 with the work done to optimise that process.

You can get a review of that fix here https://github.com/ryanluker/vscode-coverage-gutters/issues/231#issuecomment-522339044 which might solve your issue.

ryanluker commented 4 years ago

@omihalas 2.4.1 has been released, going to close this but I can reopen it if your issue persists.

omihalas commented 4 years ago

Hello, I have updated the plugin. The bug is still present and the problem got even worse. The lines in the editor remain uncolored. :| even with the files that were rendered last time.

ryanluker commented 4 years ago

@omihalas thanks for the quick response. Looking at the the cov.xml again it almost seems like you only have coverage for the test files and nothing else (given that the 7 files all go something like file name="C:\wamp\www\test\codeCoverage). This maybe more of an issue with generating the coverage for the correct module.

Maybe take a look at the example php project https://github.com/ryanluker/vscode-coverage-gutters/tree/master/example/php.

One other issue could be with the lack of normalizing on the workspace file name https://github.com/ryanluker/vscode-coverage-gutters/pull/241 but I am not 100% sure that is related to your issue.

omihalas commented 4 years ago

Hello, to generate the cov.xml i am using the phpunit package "phpunit/php-code-coverage": "^2.2" Screenshot_1 Please see this screenshots. The only problem is with files that are defined outside the package xml attribute

ryanluker commented 4 years ago

@omihalas the current way the extension works, by default, is it requires files to be inside the workspace that you have open this might be causing your issue. There is a work around that I have pasted below, you can us this to help with the path switching in the coverage files.

        "coverage-gutters.remotePathResolve": {
          "type": "array",
          "default": [],
          "description": "helps with coverage generated outside the local file system by swapping fragments of remote paths with local ones (EG ['/var/www/', '/home/project/']). See https://github.com/ryanluker/vscode-coverage-gutters/issues/201 for more info."
        },
ryanluker commented 4 years ago

@omihalas going to close this but please respond if we need to troubleshoot this more :+1: