.net core 2.1 coverage not coming on sonarqube

(rajesh agrawal) #1


I have deployed sonarqube community version.
Run following command to get code analysis on sonar dashboard:-
dotnet sonarscanner begin /k:“p1”
dotnet build
dotnet test
dotnet sonarscanner end

After above commands , we go back to sonar dashboard, all things are coming but code coverage not coming.
When i go to .net core 2.1 solution directory , The coverage “XXXXX_ABHJHKKJS 2018-09-03 13_08_45.coverage” file is generated under /TestResults directory. Still code coverage not coming in sonar.

What need to do so that code coverage starts coming in sonarqube?


(Valeri Hristov) #2

Hi Rajesh, you would need to specify sonar.cs.vscoveragexml.reportsPaths so that sonarscanner could find the coverage report (it does not try to look for it automatically). Please, see the following article for more information:

(rajesh agrawal) #3

Thanks , surely i will check.