Summary of problem:
No code coverage showing up in SonarQube. Code smells show up…but no coverage
SonarQube Version: 7.2.0.13530 SonarC# Languages Code Analyzer for C# * 7.3 (build 5690) installed
** Sonar Scaner Plugin in Jenkins - v2.8
Find attached two files that show from Jenkins and then on SonarQube the background job. The result is no code coverage at all, shows 0%, while in the logs in Jenkins you see:
Calculating coverage result…
Generating report ‘c:\Jenkins\workspace\SonarQube\MerchandisingContentApi.Tests\coverage.opencover.xml’
I had attempted to do that before with the same result. That said, I did this again, I modified the path to be MerchandisingContentApi.Tests/coverage.opencover.xml.
And still no values in SonarQube…
I do notice a lot of debug logs like, “File ‘MerchandisingContentApi/Controllers/ContentResponseController.cs’ was already processed. Skip it”. Is that any hint?
Added after original post
The part that seems strange to me…it shows “code smells” and “duplication”, just not coverage. I created a new project to see if maybe the old project in SonarQube had some issues…but same result…
I was able to figure this out. It seems that the parameter we were using to pass the report name included a semi-colon at the end, so it wasn’t finding the report.
Would have been helpful, for a debug message saying, expected report but file was not found, so no coverage uploaded or something like that.