Closed swissspidy closed 6 years ago
@swissspidy thanks for submitting an issue. I will take a look this weekend at adding a small example php project to the examples/
folder and see if I can reproduce it.
Awesome, thank you very much! Again, let me know if I can assist with anything.
@swissspidy I got a bit further but couldnt figure out how to generate lcov type xml coverage from phpunit? checkout this PR I am working on to see what where I got to https://github.com/ryanluker/vscode-coverage-gutters/pull/141. maybe you could assist in figuring out how to generate something similar to https://github.com/ryanluker/vscode-coverage-gutters/blob/master/example/python/cov.xml as currently the best I was able to get was https://github.com/ryanluker/vscode-coverage-gutters/blob/140-php-support/example/php/cov.xml . The php cov.xml wouldn't load through cobertura-parse though and silently fails inside it's parse file call.
@ryanluker I don't think it's possible, because phpunit xml is based on junit. @sebastianbergmann is there another way ?
Ah I see, those are quite different.
I guess it's easiest if this format could be converted to lcov. For this I just found https://www.npmjs.com/package/@cvrg-report/clover-json. The code itself looks rather straightforward: https://github.com/cvrg-report/clover-json/blob/ff11325f0543eb4e50c276ee0424365944ee980f/src/index.js
This could fit into LcovParser
. Basically:
<?xml
, <coverage
, and <project
, convert clover/junit XML into lcov.<?xml
call xmlExtract
as nowlcovExtract
@cvrg-report/clover-json
is licensed under MIT as well, so there shouldn't be any problems.
@swissspidy yes that approach sounds like it should work, I will take a first stab at implementing something this weekend in the branch I mentioned earlier. @pedroresende thanks for the extra info around phpunit xml option being junit, I think having the clover option should be enough for most php developers.
@swissspidy #141 finally got the php side working, thanks for doing the research and the if else block! It ended up working perfectly https://github.com/ryanluker/vscode-coverage-gutters/pull/141/commits/50ea4fea491d9b69a8ee46143b6df1ab80d5ceb3#diff-3661d843d67f46cb9cfd476ad7e1920cR26 . I will release 2.1.0 this afternoon (pst) to the marketplace and will publish a release to github soon.
Hey there
I'm running into an issue when trying to use version 2 of this extension with VSCode 1.24 and a coverage report from a PHP project.
I used PHPUnit to create a coverage report in XML (Clover) and set
coverage-gutters.xmlname
accordingly in the settings.When I now want to display the coverage, I get the following output:
Happy to provide access to a sample repo / XML file if needed.