Code Coverage not working In SoanrQube

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • I’m running Community Edition Version 8.9.2 (build 46101)

  • sonar-scanner-msbuild-5.1

  • OpenCover for .net coverage

  • what are you trying to achieve:
    I’m trying to get Code coverage to show in SonarQube project page. it suddenly stop displaying the coverage on SonarQube UI which was working fine before.
    Adding the debug log file
    DebugLog.txt (329.4 KB)

Let me know if additional info is needed.

Hey there.

Sure looks like everything should be fine.

INFO: Sensor C# [csharp] (done) | time=5678ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.Test\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DracoModel.Test.Integration\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DracoModel.Test.Integration\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DracoModel.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DracoModel.Test\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.Git.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.Git.Test\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.CommonServices.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.CommonServices.Test\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DataTools.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.DataTools.Test\coverage.opencover.xml
INFO: Parsing the OpenCover report D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.ViewData.Test\coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\GitWorkspace\RailDNAViewerDesktop\.UK_E_DPS\.\.E_DPS.ViewData.Test\coverage.opencover.xml
INFO: Coverage Report Statistics: 200 files, 149 main files, 149 main files with coverage, 51 test files, 0 project excluded files, 0 other language files.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=3683ms

What do you see in the SonarQube UI (at https://sonarqube.mobility.com/dashboard?id=org..mo.mm.entegro.camelentegroapp)? Sharing a screenshot would be great.

Please also try using the latest version of the Scanner for MSBuild/.NET, v5.7.2

Hey,

for this red highlighted component am not getting the coverage display.
see the below SS.

I would suggest you focus on a specific file in that folder you expect to see coverage reported for, and make sure it’s marked as covered in one of the reports you see being imported to SonarQube. If you can show a snippet of the XML file that displays that coverage, all the better.

And, as mentioned before, make sure to use the latest version of the scanner.