For SonarQube to bring code coverage for the dotnet code project and for the node code project need some guidance.
Here, the SonarQube is Enterprise Edition Version 8.9.10 (build 61524), we are using Azure DevOps and integrated SonarQube where the Self-hosted Virtual Machine is in place where the entire processes will be running for SonarQube.
Integration is done and getting the security issues count details. But not getting the code coverage in sonarqube ui even when we perform code coverage step in VM and pass the coverage results to sonarqube.
Locally tried to generate code coverage for dotnet with below command:
dotnet coverage collect dotnet test --output .\Tests\CodeCoverage --output-format cobertura
dotnet tool run reportgenerator -reports:.\Tests\CodeCoverage.cobertura.xml -targetdir:“.\Tests\CoverageReport” -reporttypes:Html
But still not able to pass the code coverage report to sonarqube tried these properties:
sonar.coverageReportPaths= src/dotnetprojectfolder/project…Test/Tests/CoverageReport/index.htm
sonar.coverageReportPaths=$(Build.SourcesDirectory)/src/dotnetprojectfolder/project…Test/Tests/CoverageReport/index.htm
sonar.cs.vscoveragexml.reportsPaths= src/dotnetprojectfolder/project.Test/Tests/CodeCoverage.cobertura.xml
sonar.cs.vscoveragexml.reportsPaths= $(Build.SourcesDirectory)/src/dotnetprojectfolder/project.Test/Tests/CodeCoverage.cobertura.xml
Please help tried all the option and also tried this sonarqube document in the link:
Please share the solution for this.