* Sonar: 7.9.1
* Scanner: sonar-scanner-msbuild-188.8.131.528-net46
What are you trying to achieve
* Get code coverage result of my project in Sonar server from Gitlab CI tool
- On execution of the below script from Gitlab (CI Tool), the coverage is not reflected in Sonar Server. When the same script is ran from a local machine we can see the coverage in the server.
- The coverage file and supporting artifacts ‘AppCoverageReport.html’ is placed in the root directory of the project (to ensure we dont get into coverage tool issues).
- SonarScanner.MSBuild.exe begin /k:“ProjectName” /d:sonar.host.url=“SonarServerURL” /d:sonar.login=“AccessToken” /d:sonar.cs.dotcover.reportsPaths=“AppCoverageReport.html”
- SonarScanner.MSBuild.exe end /d:sonar.login="<REDACTED>"
- Cloning the repository on local machine and running the above commands works and we can see the coverage result in sonar qube
- Logs for local as well as Gitlab with ‘/d:sonar.verbose=true’ are attached
- Project path is hidden in the CI runner
- Additional dot in the coverage report path \full\path.\AppCoverageReport\src\998.html
- But the file is scanned as if ifle was not present we see the command to throw an error