Reputation: 121
In order to import a coverage file to SonarQube, I'm executing CodeCoverage.exe to convert a ".coverage" file to xml.
I execute a cmd line like: CodeCoverage.exe analyze /output:[name of xml file to be generated] [name of the coverage binary file].coverage
but I do not get any output xml and no errors.
I must say that I was able to generate such xml for tests of other solution files.
What can be the problem? How can I troubleshoot it?
Thanks!
Upvotes: 3
Views: 3510
Reputation: 5727
I've faced a same problem today and I finally found a workaround: use tools created by one of stackoverflow.com users: @stef-heyenrath:
In short:
dotnet tool install --global dotnet-coverageconverter
.coverage
file to .coveragexml
:dotnet-coverageconverter --CoverageFilesFolder "ProjectName.Tests\TestResults\DirectoryContainsCoverageFile"
Generated file it's fully supported by SonarQube btw.
Upvotes: 1
Reputation: 41
I encountered this same issue. There should be errors in the event log. What fixed it for me was using an absolute path to the .coverage file. .xml extension for the output file is fine.
Upvotes: 1
Reputation: 39
I would start with making sure you're naming the new file with the extension *.coveragexml
CodeCoverage.exe analyze /output:[name of xml file to be generated].coveragexml [name of the coverage binary file].coverage
Upvotes: 2