Hi,
We use SonarQube 9.3.0.51899.
We have a C# .NET core project with 100% branch coverage of the unit tests.
When we execute the UT and import the report to SQ, the coverage is 30%.
These are the steps in the process:
-
downloaded dotnet-sdk-3.1.417-linux-x64.tar.gz
-
dotnet sonarscanner begin /k:"${params.Microservice}" /v:${build_version} /n:"${params.Microservice}" /d:sonar.coverageReportPaths=“sonarqubecoverage/SonarQube.xml” /d:sonar.branch.name=${params.Branch} /d:sonar.qualitygate.wait=true (with builder dotnet)
-
dotnet build (with builder dotnet)
./dotnet test --no-build “file.sln” --collect:“XPlat Code Coverage” (with downloaded dotnet)
reportgenerator “-reports:/TestResults//coverage.cobertura.xml” “-targetdir:sonarqubecoverage” “-reporttypes:SonarQube”
dotnet sonarscanner end (with builder dotnet)
Can you please advise?
Thanks in advanced,
Gal