We are seeing a problem where the dotCover HTML report representing coverage is not getting reflected in SonarCloud. The technique we are employing is the same one we’ve done in the past where we combine multile *.dcvr files into a single one and then create an HTML report from it using the dotCover “merge” and “report” verbs. The resulting HTML looks to contain all of the coverage data and the sonar-scanner looks like it found the file…but the project in SonarCloud does not show anything being covered (it shows 0% for coverage).
The only thing different between the builds we are seeing this on and the ones where we see coverage getting correctly reported is in the sonar-scanner itself. We are using dotnet global tools version of sonar-scanner so that we can run the scan within a linux environment…whereas, we were using a win32 executable on a windows machine for the build definitions where we see successful coverage data getting transmitted.
Outside of the coverage data not getting reported correctly, everything else is showing up in the project within SonarCloud correctly when we use the linux-based dotnet global tool of sonar-scanner…so the general connectivity to SonarCloud is properly resolving.
Here is the community thread also tracking this issue: dotCover code coverage not showing in SonarCloud
Hello and welcome to the community!
Please give us the following version information:
- what is the version of SonarQube that you are using?
- what is the version of the Scanner for .NET (MSBuild) that you are using?
- what version of MSBuild are you using?
And we’ll need the logs:
- please give us the verbose output of the scanner commands (please run
SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the
- please give the output of running MSBuild in verbose mode (
Also, please tell us:
- what are the commands you are running to do the analysis?
- are you running all commands from the same folder?
In addition, please see the following guides:
The output of the verbose logging and the command we are using to kick off the scan is located in the linked community article. The logs will show you what commands are getting executed. It shows that the scanner is detecting the coverage.html file that gets generated during unit testing and that is the last thing I see from the logs. The tools are all being run from the root of the code source and the detection of the coverage.html file by the scanner seems to indicate that everything is running from the right working directory.
Version of the tools is as follows:
dotnet-scanner (the sonar dotnet global tool): 5.3.1
.NET SDK: 3.1.413, 5.0.402
dotnet build tool: 5.0.11
OS platform: Linux
OS ver: Ubuntu 20.04
.NET runtimes: 3.1.19, 5.0.11
Closing this thread - being handled in this thread.