Unable to show code coverage in SonarCloud Dashboard

  • ALM used (Azure DevOps)
  • CI system used: Azure DevOps
  • Languages of the repository: .Net Core
  • Error observed: SonarCloud unable to show code coverage in Dashboard. Please find the below screenshot:
    Also attached the detailed log of “Run Code Analysis” task.
    Already tried: 1. Added ProjectGuid in all projects
  1. Added DebugType>Full</DebugType in all projects

How can we show the Code Coverage in SonarCloud Dashboard?

image

Detailed log:

2020-09-25T07:29:30.3145849Z ##[section]Starting: Run Code Analysis
2020-09-25T07:29:30.3251213Z ==============================================================================
2020-09-25T07:29:30.3251552Z Task : Run Code Analysis
2020-09-25T07:29:30.3251891Z Description : Run scanner and upload the results to the SonarCloud server.
2020-09-25T07:29:30.3252183Z Version : 1.15.0
2020-09-25T07:29:30.3252421Z Author : sonarsource
2020-09-25T07:29:30.3253026Z Help : Version: 1.15.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information
2020-09-25T07:29:30.3253706Z ==============================================================================
2020-09-25T07:29:30.5969776Z [command]D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.12.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
2020-09-25T07:29:30.6577415Z SonarScanner for MSBuild 4.10
2020-09-25T07:29:30.6578487Z Using the .NET Framework version of the Scanner for MSBuild
2020-09-25T07:29:30.7012047Z Post-processing started.
2020-09-25T07:29:31.1624496Z 07:29:31.161 Fetching code coverage report information from TFS…
2020-09-25T07:29:31.1642330Z 07:29:31.163 Attempting to locate a test results (.trx) file…
2020-09-25T07:29:31.1812338Z 07:29:31.18 Looking for TRX files in: D:\a\1\TestResults, D:\a\1\s\TestResults
2020-09-25T07:29:31.1815807Z 07:29:31.181 The following test results files were found: D:\a\1\s\TestResults\VssAdministrator_fv-az639_2020-09-25_07_29_12.trx
2020-09-25T07:29:31.2262273Z 07:29:31.225 The following code coverage attachments were found from the trx files: D:\a\1\s\TestResults\VssAdministrator_fv-az639_2020-09-25_07_29_12\In\fv-az639\VssAdministrator_fv-az639_2020-09-25.07_29_06.coverage
2020-09-25T07:29:31.7261026Z WARNING: File ‘C:\Users\VssAdministrator.nuget\packages\microsoft.net.test.sdk\16.2.0\build\netcoreapp1.0\Microsoft.NET.Test.Sdk.Program.cs’ is not located under the root directory ‘D:\a\1\s’ and will not be analyzed.
2020-09-25T07:29:31.7262429Z WARNING: File ‘C:\Users\VssAdministrator.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll’ is not located under the root directory ‘D:\a\1\s’ and will not be analyzed.
2020-09-25T07:29:31.7263833Z WARNING: File ‘C:\Users\VssAdministrator.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.reporters.netcoreapp10.dll’ is not located under the root directory ‘D:\a\1\s’ and will not be analyzed.
2020-09-25T07:29:31.7265283Z WARNING: File ‘C:\Users\VssAdministrator.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.utility.netcoreapp10.dll’ is not located under the root directory ‘D:\a\1\s’ and will not be analyzed.
2020-09-25T07:29:31.7459931Z Calling the SonarQube Scanner…
2020-09-25T07:29:36.0184560Z INFO: Scanner configuration file: D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.12.0\classic-sonar-scanner-msbuild\sonar-scanner-4.4.0.2170\bin…\conf\sonar-scanner.properties
2020-09-25T07:29:36.0299665Z INFO: Project root configuration file: D:\a\1.sonarqube\out\sonar-project.properties
2020-09-25T07:29:36.7680755Z INFO: SonarScanner 4.4.0.2170
2020-09-25T07:29:36.7681585Z INFO: Java 11.0.8 AdoptOpenJDK (64-bit)
2020-09-25T07:29:36.7682146Z INFO: Windows Server 2016 10.0 amd64
2020-09-25T07:29:41.0356852Z INFO: User cache: C:\Users\VssAdministrator.sonar\cache
2020-09-25T07:29:45.7873329Z INFO: Scanner configuration file: D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.12.0\classic-sonar-scanner-msbuild\sonar-scanner-4.4.0.2170\bin…\conf\sonar-scanner.properties
2020-09-25T07:29:45.7874107Z INFO: Project root configuration file: D:\a\1.sonarqube\out\sonar-project.properties
2020-09-25T07:29:45.7874435Z INFO: Analyzing on SonarCloud
2020-09-25T07:29:45.7874813Z INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
2020-09-25T07:29:47.4417136Z INFO: Load global settings
2020-09-25T07:29:48.0481537Z INFO: Load global settings (done) | time=609ms
2020-09-25T07:29:48.0533890Z INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
2020-09-25T07:29:48.1058676Z INFO: User cache: C:\Users\VssAdministrator.sonar\cache
2020-09-25T07:29:48.1096278Z INFO: Load/download plugins
2020-09-25T07:29:48.1097086Z INFO: Load plugins index
2020-09-25T07:29:48.3938523Z INFO: Load plugins index (done) | time=282ms
2020-09-25T07:30:13.6775378Z INFO: Load/download plugins (done) | time=25568ms
2020-09-25T07:30:14.2678250Z INFO: Loaded core extensions: developer-scanner
2020-09-25T07:30:15.3562598Z INFO: Process project properties
2020-09-25T07:30:15.3877846Z INFO: Execute project builders
2020-09-25T07:30:15.5439982Z INFO: Execute project builders (done) | time=158ms
2020-09-25T07:30:15.5459654Z INFO: Project key: xPress_Adapt2_Functions_Net
2020-09-25T07:30:15.5460900Z INFO: Base dir: D:\a\1\s
2020-09-25T07:30:15.5461424Z INFO: Working dir: D:\a\1.sonarqube\out.sonar
2020-09-25T07:30:15.6905959Z INFO: Load project settings for component key: ‘xPress_Adapt2_Functions_Net’
2020-09-25T07:30:15.9579438Z INFO: Load project settings for component key: ‘xPress_Adapt2_Functions_Net’ (done) | time=219ms
2020-09-25T07:30:15.9969402Z INFO: Found an active CI vendor: ‘Azure DevOps’
2020-09-25T07:30:15.9983114Z INFO: Load project branches
2020-09-25T07:30:16.1291446Z INFO: Load project branches (done) | time=137ms
2020-09-25T07:30:16.1292148Z INFO: Check ALM binding of project ‘xPress_Adapt2_Functions_Net’
2020-09-25T07:30:16.2372444Z INFO: Detected project binding: NOT_BOUND
2020-09-25T07:30:16.2372924Z INFO: Check ALM binding of project ‘xPress_Adapt2_Functions_Net’ (done) | time=106ms
2020-09-25T07:30:16.2373244Z INFO: Load project pull requests
2020-09-25T07:30:16.3423042Z INFO: Load project pull requests (done) | time=103ms
2020-09-25T07:30:16.3985138Z INFO: Load branch configuration
2020-09-25T07:30:16.3985882Z INFO: Load branch configuration (done) | time=2ms
2020-09-25T07:30:16.3986261Z INFO: Load quality profiles
2020-09-25T07:30:16.6388864Z INFO: Load quality profiles (done) | time=238ms
2020-09-25T07:30:16.6389518Z INFO: Load active rules
2020-09-25T07:30:20.4219151Z INFO: Load active rules (done) | time=3774ms
2020-09-25T07:30:20.4480196Z INFO: Organization key: betm
2020-09-25T07:30:20.4853207Z INFO: Indexing files…
2020-09-25T07:30:20.4853567Z INFO: Project configuration:
2020-09-25T07:30:22.2174617Z INFO: Indexing files of module ‘Adapt2DataCollectorNetCore.Test’
2020-09-25T07:30:22.2176881Z INFO: Base dir: D:\a\1\s\Adapt2DataCollectorNetCore.Test
2020-09-25T07:30:22.2177489Z INFO: Test paths: AF_HTTP_ADAPT2_A2_AWARDSDataCollectorDurableTest.cs, AF_HTTP_AD…
2020-09-25T07:30:22.2177925Z INFO: Load project repositories
2020-09-25T07:30:22.6021367Z INFO: Load project repositories (done) | time=116ms
2020-09-25T07:30:22.6336668Z INFO: Indexing files of module ‘Adapt2dataCollectorNetCore’
2020-09-25T07:30:22.7252879Z INFO: Base dir: D:\a\1\s\Adapt2dataCollectorNetCore
2020-09-25T07:30:22.7259024Z INFO: Source paths: AF_HTTP_ADAPT2_A2_AWARDSDataCollector.cs, AF_HTTP_ADAPT2_A2_A…
2020-09-25T07:30:22.7259656Z INFO: Indexing files of module ‘xPress_Adapt2_Functions_Net’
2020-09-25T07:30:22.7260134Z INFO: Base dir: D:\a\1\s
2020-09-25T07:30:22.7261758Z INFO: 41 files indexed
2020-09-25T07:30:22.7262201Z INFO: 4 files ignored because of scm ignore settings
2020-09-25T07:30:22.7262653Z INFO: Quality profile for cs: Sonar way
2020-09-25T07:30:22.7263198Z INFO: ------------- Run sensors on module Adapt2DataCollectorNetCore.Test
2020-09-25T07:30:22.7263653Z INFO: Load metrics repository
2020-09-25T07:30:22.7264196Z INFO: Load metrics repository (done) | time=119ms
2020-09-25T07:30:24.8611992Z WARNING: WARNING: An illegal reflective access operation has occurred
2020-09-25T07:30:24.8613636Z WARNING: WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/VssAdministrator/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
2020-09-25T07:30:24.8615887Z WARNING: WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
2020-09-25T07:30:24.8616874Z WARNING: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2020-09-25T07:30:24.8617620Z WARNING: WARNING: All illegal access operations will be denied in a future release
2020-09-25T07:30:27.4931328Z INFO: Sensor SonarCSS Rules [cssfamily]
2020-09-25T07:30:27.4932085Z INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2020-09-25T07:30:27.4932667Z INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
2020-09-25T07:30:27.4933100Z INFO: Sensor C# Properties [csharp]
2020-09-25T07:30:27.7955084Z INFO: Sensor C# Properties [csharp] (done) | time=58ms
2020-09-25T07:30:27.7979862Z INFO: Sensor JavaXmlSensor [java]
2020-09-25T07:30:27.7980469Z INFO: Sensor JavaXmlSensor [java] (done) | time=14ms
2020-09-25T07:30:27.7980943Z INFO: Sensor JaCoCo XML Report Importer [jacoco]
2020-09-25T07:30:27.7981779Z INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
2020-09-25T07:30:27.7982537Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2020-09-25T07:30:27.7983067Z INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
2020-09-25T07:30:27.7983546Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
2020-09-25T07:30:27.7984205Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
2020-09-25T07:30:27.7984754Z INFO: ------------- Run sensors on module Adapt2dataCollectorNetCore
2020-09-25T07:30:27.7985221Z INFO: Sensor SonarCSS Rules [cssfamily]
2020-09-25T07:30:27.7985796Z INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2020-09-25T07:30:27.7986318Z INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=1ms
2020-09-25T07:30:27.7986774Z INFO: Sensor C# Properties [csharp]
2020-09-25T07:30:27.7987206Z INFO: Sensor C# Properties [csharp] (done) | time=1ms
2020-09-25T07:30:27.7987650Z INFO: Sensor JavaXmlSensor [java]
2020-09-25T07:30:27.7988078Z INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
2020-09-25T07:30:27.7988483Z INFO: Sensor HTML [web]
2020-09-25T07:30:27.7989159Z INFO: Sensor HTML [web] (done) | time=4ms
2020-09-25T07:30:27.7989594Z INFO: Sensor JaCoCo XML Report Importer [jacoco]
2020-09-25T07:30:27.7990340Z INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
2020-09-25T07:30:27.7991135Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2020-09-25T07:30:27.7991709Z INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
2020-09-25T07:30:27.7992205Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
2020-09-25T07:30:27.7992765Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
2020-09-25T07:30:27.7993285Z INFO: ------------- Run sensors on module xPress_Adapt2_Functions_Net
2020-09-25T07:30:27.8849095Z INFO: Sensor SonarCSS Rules [cssfamily]
2020-09-25T07:30:27.8854306Z INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2020-09-25T07:30:27.9693716Z INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=0ms
2020-09-25T07:30:27.9694062Z INFO: Sensor JavaXmlSensor [java]
2020-09-25T07:30:27.9694326Z INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
2020-09-25T07:30:27.9694718Z INFO: Sensor JaCoCo XML Report Importer [jacoco]
2020-09-25T07:30:27.9695284Z INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
2020-09-25T07:30:27.9696293Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2020-09-25T07:30:27.9696679Z INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
2020-09-25T07:30:27.9697031Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
2020-09-25T07:30:27.9697377Z INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
2020-09-25T07:30:27.9697717Z INFO: Sensor JavaSecuritySensor [security]
2020-09-25T07:30:27.9698044Z INFO: Reading type hierarchy from: D:\a\1.sonarqube\out.sonar\ucfg2\java
2020-09-25T07:30:27.9698363Z INFO: Read 0 type definitions
2020-09-25T07:30:27.9698652Z INFO: Reading UCFGs from: D:\a\1.sonarqube\out.sonar\ucfg2\java
2020-09-25T07:30:27.9698986Z INFO: No UCFGs have been included for analysis.
2020-09-25T07:30:27.9699285Z INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
2020-09-25T07:30:27.9699573Z INFO: Sensor CSharpSecuritySensor [security]
2020-09-25T07:30:27.9699943Z INFO: Reading type hierarchy from: D:\a\1.sonarqube\out\ucfg_cs2
2020-09-25T07:30:27.9700508Z INFO: Read 10 type definitions
2020-09-25T07:30:27.9744774Z INFO: Reading UCFGs from: D:\a\1.sonarqube\out\ucfg_cs2
2020-09-25T07:30:28.2854599Z INFO: No UCFGs have been included for analysis.
2020-09-25T07:30:28.2855579Z INFO: Sensor CSharpSecuritySensor [security] (done) | time=304ms
2020-09-25T07:30:28.3211299Z INFO: Sensor PhpSecuritySensor [security]
2020-09-25T07:30:28.3211803Z INFO: Reading type hierarchy from: D:\a\1.sonarqube\out.sonar\ucfg2\php
2020-09-25T07:30:28.3212118Z INFO: Read 0 type definitions
2020-09-25T07:30:28.3212437Z INFO: Reading UCFGs from: D:\a\1.sonarqube\out.sonar\ucfg2\php
2020-09-25T07:30:28.3212759Z INFO: No UCFGs have been included for analysis.
2020-09-25T07:30:28.3213086Z INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
2020-09-25T07:30:28.3213386Z INFO: Sensor PythonSecuritySensor [security]
2020-09-25T07:30:28.3213743Z INFO: Reading type hierarchy from: D:\a\1.sonarqube\out.sonar\ucfg2\python
2020-09-25T07:30:28.3214060Z INFO: Read 0 type definitions
2020-09-25T07:30:28.3214354Z INFO: Reading UCFGs from: D:\a\1.sonarqube\out.sonar\ucfg2\python
2020-09-25T07:30:28.3214698Z INFO: No UCFGs have been included for analysis.
2020-09-25T07:30:28.3215001Z INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
2020-09-25T07:30:28.3215318Z INFO: ------------- Run sensors on project
2020-09-25T07:30:28.3215737Z INFO: Sensor C# [csharp]
2020-09-25T07:30:28.3216160Z INFO: Importing results from 5 proto files in ‘D:\a\1.sonarqube\out\3\output-cs’
2020-09-25T07:30:28.3505531Z INFO: Importing results from 5 proto files in ‘D:\a\1.sonarqube\out\1\output-cs’
2020-09-25T07:30:28.3531959Z INFO: Importing results from 5 proto files in ‘D:\a\1.sonarqube\out\2\output-cs’
2020-09-25T07:30:28.6010354Z INFO: Importing results from 5 proto files in ‘D:\a\1.sonarqube\out\0\output-cs’
2020-09-25T07:30:28.6607898Z INFO: Importing 4 Roslyn reports
2020-09-25T07:30:28.8318333Z INFO: Sensor C# [csharp] (done) | time=613ms
2020-09-25T07:30:28.8319254Z INFO: Sensor C# Tests Coverage Report Import [csharp]
2020-09-25T07:30:28.8320083Z INFO: Parsing the Visual Studio coverage XML report D:\a\1\s\TestResults\VssAdministrator_fv-az639_2020-09-25_07_29_12\In\fv-az639\VssAdministrator_fv-az639_2020-09-25.07_29_06.coveragexml
2020-09-25T07:30:28.8672210Z INFO: Adding this code coverage report to the cache for later reuse: D:\a\1\s\TestResults\VssAdministrator_fv-az639_2020-09-25_07_29_12\In\fv-az639\VssAdministrator_fv-az639_2020-09-25.07_29_06.coveragexml
2020-09-25T07:30:28.8804403Z INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=52ms
2020-09-25T07:30:28.8804878Z INFO: Sensor C# Unit Test Results Import [csharp]
2020-09-25T07:30:28.8805315Z INFO: Parsing the Visual Studio Test Results file ‘D:\a\1\s\TestResults\VssAdministrator_fv-az639_2020-09-25_07_29_12.trx’.
2020-09-25T07:30:28.8825478Z INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=13ms
2020-09-25T07:30:28.8826180Z INFO: Sensor Zero Coverage Sensor
2020-09-25T07:30:28.9547062Z INFO: Sensor Zero Coverage Sensor (done) | time=71ms
2020-09-25T07:30:28.9663982Z INFO: SCM Publisher SCM provider for this project is: git
2020-09-25T07:30:28.9675740Z INFO: SCM Publisher 16 source files to be analyzed
2020-09-25T07:30:29.4402148Z INFO: SCM Publisher 16/16 source files have been analyzed (done) | time=472ms
2020-09-25T07:30:29.4822310Z INFO: CPD Executor 2 files had no CPD blocks
2020-09-25T07:30:29.4822701Z INFO: CPD Executor Calculating CPD for 18 files
2020-09-25T07:30:29.5869827Z INFO: CPD Executor CPD calculation finished (done) | time=83ms
2020-09-25T07:30:30.6897578Z INFO: Analysis report generated in 1109ms, dir size=462 KB
2020-09-25T07:30:30.7670823Z INFO: Analysis report compressed in 87ms, zip size=165 KB
2020-09-25T07:30:31.1097322Z INFO: Analysis report uploaded in 344ms
2020-09-25T07:30:31.1230111Z INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=xPress_Adapt2_Functions_Net
2020-09-25T07:30:31.1231019Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2020-09-25T07:30:31.1231709Z INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AXTEK63hZg8dIi10qn8Y
2020-09-25T07:30:31.1728166Z INFO: Analysis total time: 16.905 s
2020-09-25T07:30:31.1765115Z INFO: ------------------------------------------------------------------------
2020-09-25T07:30:31.2032555Z INFO: EXECUTION SUCCESS
2020-09-25T07:30:31.2033184Z INFO: ------------------------------------------------------------------------
2020-09-25T07:30:31.2033739Z INFO: Total time: 55.198s
2020-09-25T07:30:31.2680305Z INFO: Final Memory: 30M/104M
2020-09-25T07:30:31.2681035Z INFO: ------------------------------------------------------------------------
2020-09-25T07:30:31.3274377Z The SonarQube Scanner has finished
2020-09-25T07:30:31.3318185Z 07:30:31.33 Post-processing succeeded.
2020-09-25T07:30:31.3509287Z ##[section]Finishing: Run Code Analysis

Hi @sudip and welcome to the community !

Would it be possible to have this same log for Run Code Analysis task, but in debug mode ?
There are more information concerning the parsing of the coverage file, this might help us troubleshoot.

Thanks in advance.
Mickaël

Hi @Mickael, Please find the below logs from Debug Mode:

Thank you.

Can you check that paths inside the coveragexml file match the ones that are analyzed ?