- Team City build pipeline to run .NET Visual Studio tests - was wired to use “Sonar Scanner for .NET”
- the build is creating coverage and shows it in Team City , the report file was also created.
- But SonarQube for the project still shows 0 coverage.
- Searched for similar issues in current forum, but could not find something similar that resolved the issue that i see in the build log = Sensor Zero Coverage Sensor
Build log attached
SonarQube_Build.log (37.9 KB)
Welcome to the community!
The log you’ve attached shows the end step running immediately after the begin step, with no build or coverage generation between them. Is that actually what happens? Also, It looks like your coverage actually runs after analysis. The order needs to be:
Actually , i deleted a bulk of the build logs between the both - start and end. The start and end are in fact bookends to the true build and coverage.
Team city is showing coverage results and we have the results file. The file is not getting pushed to SonarQube is the issue. If you want to see the entire log, i can put that out here. From another build we just ran.
FIRE_AutoCAD_Commit_Build_and_Run_Unit_Tests_220.127.116.11.log (195.7 KB)
In the part of your log that’s labeled for the begin step, I don’t actually see the begin step, I see stuff about PowerShell. Do you have a PS script executing the begin command? I was looking for it to double-check the
not really, the begin step is just using the Runner - “SonarScanner for .NET (dotnet scanner)”.
no powershell script to indicate reportpaths.
There is a unit test step right before the end - that is the Visual Studio tests - running step, it takes additional parameters, shall i set the sonar.cs.dotcover.reportsPaths path there ? if so how?
In the latest verion of SonarQube we’ve improved the documentation for .NET coverage including a sample of how to setup dotcover and where to set the reportspath. It can be found here.
Let me know if you’re still having problems
Thanks Tom. I did go through the documentation and checked the meta runner we are using to include more debug information to pick up.
Issue seems to have been caused with - though coverage report was generated, there was no source code for the coverage that SonarQube was expecting.
Resolved the issue by changing the way we were building our solution - and have the source code show up in Team city code coverage. Once that was showing up - SonarQube started showing coverage. All set. Thank you so much for sending the documentation. That is definitely helpful.