I am using SonarQube Version 8.9.6 (build 50800). Using OpenCover to determine code coverage for a c#10 project (.Net 6)
I want to get the code coverage report. Using dotnet CLI to run the tests. The tests are running and the file is being created but the coverage file is empty.
I am using this command:
-oldstyle -log:warn -returntargetcode -register:Path64 -output:coverage.xml -mergebyhash “-target:dotnet.exe” “-targetargs:test --no-build --no-restore --configuration Release – NUnit.TestOutputXml=${bamboo.build.working.directory}\Result”
Without full logs from the command you’re running, it will be hard to diagnose anything.
A couple of pointers:
At the end of the day, SonarQube isn’t involved in generating the report, only in reading the report. If it’s empty… this might not be the right forum to ask for help.
Regarding altCover, OpenCover or coverlet - these tools support the opencover reports, and you can use whichever of these tools to generate code coverage reports in the opencover format.