Test coverage always on 0% (.net core - Github Action)

ALM used (GitHub, Bitbucket Cloud, Azure DevOps)

Github

CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI)

Github Action

Scanner command used when applicable (private details masked)

Check build.yaml

Languages of the repository

.netstandard2.0 (package) and .net6 for test project.

Only if the SonarCloud project is public, the URL

Build file

Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Test coverage always shows as 0.0%.
The Sonarqube I’ve used before (privately hosted) showed 100% test coverage.
I’ve searched and tried a bunch of solutions, but so far, nothing worked. I’m probably doing wrong something very basic, but I can’t figure out what.

The current build file is here: validator-dot-net/build.yml at dotnet-migration · brenordv/validator-dot-net · GitHub
Any help will be appreciated.
Thanks in advance!

Steps to reproduce

Run the pipeline.

Hi,

Welcome to the community!

Can you share your analysis logs, ideally starting from the begin command?

 
Thx,
Ann

Sure! Here you go:

Run dotnet tool install --global dotnet-coverage
Tool 'dotnet-coverage' is already installed.
SonarScanner for MSBuild 5.6
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
20:29:52.863  Updating build integration targets...
20:29:53.462  Fetching analysis configuration settings...
20:29:54.279  Provisioning analyzer assemblies for cs...
20:29:54.28  Installing required Roslyn analyzers...
20:29:55.456  Provisioning analyzer assemblies for vbnet...
20:29:55.456  Installing required Roslyn analyzers...
20:29:55.517  Pre-processing succeeded.
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
  Determining projects to restore...
  Restored D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet\ValidatorDotNet.csproj (in 6.61 sec).
  Restored D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet.Tests\ValidatorDotNet.Tests.csproj (in 1.01 min).
  ValidatorDotNet -> D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet\bin\Release\netstandard2.0\ValidatorDotNet.dll
  Sonar: (ValidatorDotNet.csproj) Project processed successfully
  Successfully created package 'D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet\bin\Release\raccoon.ninja.validator.net.1.0.3.nupkg'.
  ValidatorDotNet.Tests -> D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet.Tests\bin\Release\net6.0\ValidatorDotNet.Tests.dll
  Sonar: (ValidatorDotNet.Tests.csproj) Project processed successfully
Build succeeded.
    0 Warning(s)
    0 Error(s)
Time Elapsed 00:01:16.77
SessionId: 97f75d84-bc18-417d-8779-1c8b8c74e567
  Determining projects to restore...
  All projects are up-to-date for restore.
  ValidatorDotNet -> D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet\bin\Debug\netstandard2.0\ValidatorDotNet.dll
  'xmldocmd' is not recognized as an internal or external command,
  operable program or batch file.
D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet\ValidatorDotNet.csproj(30,9): error MSB3073: The command "xmldocmd ValidatorDotNet.dll ..\..\..\..\Docs --obsolete --quiet --newline lf" exited with code 9009.
Code coverage results: coverage.xml.
SonarScanner for MSBuild 5.6
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
20:31:21.495  The exclude flag has been set so the project will not be analyzed. Project file: D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet.Tests\ValidatorDotNet.Tests.csproj
Calling the SonarScanner CLI...
INFO: Scanner configuration file: D:\a\validator-dot-net\validator-dot-net\.sonar\scanner\.store\dotnet-sonarscanner\5.6.0\dotnet-sonarscanner\5.6.0\tools\net5.0\any\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.15 Azul Systems, Inc. (64-bit)
INFO: Windows Server 2022 10.0 amd64
INFO: User cache: C:\Users\runneradmin\.sonar\cache
INFO: Scanner configuration file: D:\a\validator-dot-net\validator-dot-net\.sonar\scanner\.store\dotnet-sonarscanner\5.6.0\dotnet-sonarscanner\5.6.0\tools\net5.0\any\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\sonar-project.properties
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=585ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: C:\Users\runneradmin\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=143ms
INFO: Load/download plugins (done) | time=27702ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Github Actions'
INFO: Load project settings for component key: 'brenordv_validator-dot-net'
INFO: Load project settings for component key: 'brenordv_validator-dot-net' (done) | time=110ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=39ms
INFO: Project key: brenordv_validator-dot-net
INFO: Base dir: D:\a\validator-dot-net\validator-dot-net
INFO: Working dir: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar
INFO: Load project branches
INFO: Load project branches (done) | time=117ms
INFO: Check ALM binding of project 'brenordv_validator-dot-net'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'brenordv_validator-dot-net' (done) | time=103ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=107ms
INFO: Load branch configuration
INFO: Github event: push
INFO: Auto-configuring branch dotnet-migration
INFO: Load branch configuration (done) | time=165ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=150ms
INFO: Load active rules
INFO: Load active rules (done) | time=4211ms
INFO: Organization key: raccoon-ninja
INFO: Branch name: dotnet-migration, type: short-lived
INFO: Load project repositories
INFO: Load project repositories (done) | time=110ms
INFO: SCM collecting changed files in the branch
INFO: SCM collecting changed files in the branch (done) | time=394ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'ValidatorDotNet'
INFO:   Base dir: D:\a\validator-dot-net\validator-dot-net\ValidatorDotNet
INFO:   Source paths: Constants/Constraints.cs, Exceptions/BaseValidationException....
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'brenordv_validator-dot-net'
INFO:   Base dir: D:\a\validator-dot-net\validator-dot-net
INFO:   Source paths: MIT-LICENSE.txt
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: 30 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for cs: Sonar way
INFO: ------------- Run sensors on module ValidatorDotNet
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=118ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=2ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Roslyn version: 4.2.0.0
INFO: Language version: CSharp7_3
INFO: Concurrent execution: enabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=9ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor Text Sensor [text]
INFO: 27 source files to be analyzed
INFO: 27/27 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=43ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=17ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
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
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=1ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=6ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=2ms
INFO: ------------- Run sensors on module brenordv_validator-dot-net
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=0ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=0ms
INFO: Sensor Text Sensor [text]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=2ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
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
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=2ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=0ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ir\java
INFO: No IR files have been included for analysis.
INFO: Sensor javabugs [dbd] (done) | time=1ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\ucfg_cs2
INFO: Read 48 type definitions
INFO: Reading UCFGs from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=277ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=1ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\.sonar\ucfg2\js
INFO: No UCFGs have been included for analysis.
INFO: Sensor JsSecuritySensor [security] (done) | time=1ms
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
INFO: Importing results from 6 proto files in 'D:\a\validator-dot-net\validator-dot-net\.sonarqube\out\0\output-cs'
INFO: Importing 1 Roslyn report
INFO: Found 1 MSBuild C# project: 1 MAIN project.
INFO: Sensor C# [csharp] (done) | time=248ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=2ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report D:\a\validator-dot-net\validator-dot-net\.\coverage.xml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\validator-dot-net\validator-dot-net\.\coverage.xml
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=48ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=13ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 2 source files to be analyzed
INFO: SCM Publisher 2/2 source files have been analyzed (done) | time=160ms
INFO: CPD Executor Calculating CPD for 27 files
INFO: CPD Executor CPD calculation finished (done) | time=16ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=71ms
INFO: Analysis report generated in 474ms, dir size=250 KB
INFO: Analysis report compressed in 44ms, zip size=67 KB
INFO: Analysis report uploaded in 317ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=brenordv_validator-dot-net&branch=dotnet-migration&resolved=false
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AYE1kWaSWBYaP48rrWqe
INFO: Analysis total time: 16.423 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 48.770s
INFO: Final Memory: 35M/117M
INFO: ------------------------------------------------------------------------
The SonarScanner CLI has finished

May be a important detail, my build.yaml is the default suggested by sonarcloud.
build link: trying to fix test coverage not showing in sonarcloud · brenordv/validator-dot-net@d85448c · GitHub

Hello @raccoon,

Could you please give us the verbose level logs and upload the coverage.xml, so we can do further analysis?

Share the Scanner for .NET verbose logs

  • Add /d:"sonar.verbose=true" to the…

    • SonarScanner.MSBuild.exe or dotnet sonarscanner begin command to get more detailed logs
      • For example: SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"
  • The important logs are in the END step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)

logs_10.zip (520.3 KB)
The logs ended up a bit bigger than I expected, so I attached it here.

Sorry if it’s a silly question, but how do I access the coverage.xml created? It’s created during build, right?

Hi @raccoon,

Thanks for the logs!

One way to access the file is to use PublishPipelineArtifact task and download it from the azure job.

I’m using github actions to do this. I’ll google how to publish artifacts there.

Sorry, I though you use Azure. Never did this on GitHub.

By looking at the logs I see:

2022-06-09T14:09:23.0931185Z 14:09:23.090 INFO: Adding this code coverage report to the cache for later reuse: D:\a\validator-dot-net\validator-dot-net\.\coverage.xml
2022-06-09T14:09:23.0931788Z 14:09:23.090 DEBUG: Analyzing coverage after aggregate found '0' coverage files.
2022-06-09T14:09:23.0932225Z 14:09:23.090 DEBUG: The total number of file count statistics is '0'.

There seems to be a problem with the coverage report

I’ve updated the build file to publish coverage.xml:

      - name: Publishing coverage.xml
        uses: actions/upload-artifact@v3
        with:
          path: coverage.xml

And I got this xml file as a result:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<results>
  <skipped_modules>
    <skipped_module name="system.private.corelib.dll" path="system.private.corelib.dll" reason="no_symbols" />
    <skipped_module name="dotnet.dll" path="dotnet.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.dll" path="system.runtime.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.process.dll" path="system.diagnostics.process.dll" reason="no_symbols" />
    <skipped_module name="system.componentmodel.primitives.dll" path="system.componentmodel.primitives.dll" reason="no_symbols" />
    <skipped_module name="microsoft.win32.primitives.dll" path="microsoft.win32.primitives.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.interopservices.dll" path="system.runtime.interopservices.dll" reason="no_symbols" />
    <skipped_module name="microsoft.dotnet.cli.utils.dll" path="microsoft.dotnet.cli.utils.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.tracing.dll" path="system.diagnostics.tracing.dll" reason="no_symbols" />
    <skipped_module name="system.text.encoding.codepages.dll" path="system.text.encoding.codepages.dll" reason="no_symbols" />
    <skipped_module name="system.threading.dll" path="system.threading.dll" reason="no_symbols" />
    <skipped_module name="system.collections.dll" path="system.collections.dll" reason="no_symbols" />
    <skipped_module name="system.commandline.dll" path="system.commandline.dll" reason="no_symbols" />
    <skipped_module name="microsoft.dotnet.configurer.dll" path="microsoft.dotnet.configurer.dll" reason="no_symbols" />
    <skipped_module name="microsoft.dotnet.internalabstractions.dll" path="microsoft.dotnet.internalabstractions.dll" reason="no_symbols" />
    <skipped_module name="netstandard.dll" path="netstandard.dll" reason="no_symbols" />
    <skipped_module name="system.componentmodel.dll" path="system.componentmodel.dll" reason="no_symbols" />
    <skipped_module name="system.collections.concurrent.dll" path="system.collections.concurrent.dll" reason="no_symbols" />
    <skipped_module name="system.linq.dll" path="system.linq.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.interopservices.runtimeinformation.dll" path="system.runtime.interopservices.runtimeinformation.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.serialization.formatters.dll" path="system.runtime.serialization.formatters.dll" reason="no_symbols" />
    <skipped_module name="system.console.dll" path="system.console.dll" reason="no_symbols" />
    <skipped_module name="system.text.encoding.extensions.dll" path="system.text.encoding.extensions.dll" reason="no_symbols" />
    <skipped_module name="microsoft.applicationinsights.dll" path="microsoft.applicationinsights.dll" reason="no_symbols" />
    <skipped_module name="system.private.uri.dll" path="system.private.uri.dll" reason="no_symbols" />
    <skipped_module name="system.security.cryptography.algorithms.dll" path="system.security.cryptography.algorithms.dll" reason="no_symbols" />
    <skipped_module name="system.security.cryptography.primitives.dll" path="system.security.cryptography.primitives.dll" reason="no_symbols" />
    <skipped_module name="system.memory.dll" path="system.memory.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.dll" path="system.reflection.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.extensions.dll" path="system.reflection.extensions.dll" reason="no_symbols" />
    <skipped_module name="system.xml.xdocument.dll" path="system.xml.xdocument.dll" reason="no_symbols" />
    <skipped_module name="system.private.xml.linq.dll" path="system.private.xml.linq.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.framework.dll" path="microsoft.build.framework.dll" reason="no_symbols" />
    <skipped_module name="system.threading.thread.dll" path="system.threading.thread.dll" reason="no_symbols" />
    <skipped_module name="system.collections.nongeneric.dll" path="system.collections.nongeneric.dll" reason="no_symbols" />
    <skipped_module name="system.xml.readerwriter.dll" path="system.xml.readerwriter.dll" reason="no_symbols" />
    <skipped_module name="msbuild.dll" path="msbuild.dll" reason="no_symbols" />
    <skipped_module name="system.private.xml.dll" path="system.private.xml.dll" reason="no_symbols" />
    <skipped_module name="nuget.common.dll" path="nuget.common.dll" reason="no_symbols" />
    <skipped_module name="system.text.regularexpressions.dll" path="system.text.regularexpressions.dll" reason="no_symbols" />
    <skipped_module name="microsoft.dotnet.templatelocator.dll" path="microsoft.dotnet.templatelocator.dll" reason="no_symbols" />
    <skipped_module name="microsoft.deployment.dotnet.releases.dll" path="microsoft.deployment.dotnet.releases.dll" reason="no_symbols" />
    <skipped_module name="system.text.json.dll" path="system.text.json.dll" reason="no_symbols" />
    <skipped_module name="system.numerics.vectors.dll" path="system.numerics.vectors.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.compilerservices.unsafe.dll" path="system.runtime.compilerservices.unsafe.dll" reason="no_symbols" />
    <skipped_module name="system.threading.tasks.dll" path="system.threading.tasks.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.dll" path="microsoft.build.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.loader.dll" path="system.runtime.loader.dll" reason="no_symbols" />
    <skipped_module name="nuget.protocol.dll" path="nuget.protocol.dll" reason="no_symbols" />
    <skipped_module name="nuget.configuration.dll" path="nuget.configuration.dll" reason="no_symbols" />
    <skipped_module name="system.globalization.dll" path="system.globalization.dll" reason="no_symbols" />
    <skipped_module name="system.collections.immutable.dll" path="system.collections.immutable.dll" reason="no_symbols" />
    <skipped_module name="microsoft.win32.registry.dll" path="microsoft.win32.registry.dll" reason="no_symbols" />
    <skipped_module name="nuget.credentials.dll" path="nuget.credentials.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.tools.dll" path="system.diagnostics.tools.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.extensions.dll" path="system.runtime.extensions.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.debug.dll" path="system.diagnostics.debug.dll" reason="no_symbols" />
    <skipped_module name="system.io.compression.dll" path="system.io.compression.dll" reason="no_symbols" />
    <skipped_module name="system.io.dll" path="system.io.dll" reason="no_symbols" />
    <skipped_module name="system.text.encoding.dll" path="system.text.encoding.dll" reason="no_symbols" />
    <skipped_module name="system.security.accesscontrol.dll" path="system.security.accesscontrol.dll" reason="no_symbols" />
    <skipped_module name="system.net.http.dll" path="system.net.http.dll" reason="no_symbols" />
    <skipped_module name="system.net.primitives.dll" path="system.net.primitives.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.diagnosticsource.dll" path="system.diagnostics.diagnosticsource.dll" reason="no_symbols" />
    <skipped_module name="system.net.security.dll" path="system.net.security.dll" reason="no_symbols" />
    <skipped_module name="system.security.cryptography.x509certificates.dll" path="system.security.cryptography.x509certificates.dll" reason="no_symbols" />
    <skipped_module name="system.serviceprocess.servicecontroller.dll" path="system.serviceprocess.servicecontroller.dll" reason="no_symbols" />
    <skipped_module name="system.configuration.configurationmanager.dll" path="system.configuration.configurationmanager.dll" reason="no_symbols" />
    <skipped_module name="system.security.principal.windows.dll" path="system.security.principal.windows.dll" reason="no_symbols" />
    <skipped_module name="system.security.claims.dll" path="system.security.claims.dll" reason="no_symbols" />
    <skipped_module name="system.threading.tasks.dataflow.dll" path="system.threading.tasks.dataflow.dll" reason="no_symbols" />
    <skipped_module name="system.objectmodel.dll" path="system.objectmodel.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.emit.ilgeneration.dll" path="system.reflection.emit.ilgeneration.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.emit.lightweight.dll" path="system.reflection.emit.lightweight.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.primitives.dll" path="system.reflection.primitives.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.fileversioninfo.dll" path="system.diagnostics.fileversioninfo.dll" reason="no_symbols" />
    <skipped_module name="microsoft.net.stringtools.dll" path="microsoft.net.stringtools.dll" reason="no_symbols" />
    <skipped_module name="system.threading.tasks.parallel.dll" path="system.threading.tasks.parallel.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.tasks.core.dll" path="microsoft.build.tasks.core.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.utilities.core.dll" path="microsoft.build.utilities.core.dll" reason="no_symbols" />
    <skipped_module name="nuget.build.tasks.dll" path="nuget.build.tasks.dll" reason="no_symbols" />
    <skipped_module name="nuget.commands.dll" path="nuget.commands.dll" reason="no_symbols" />
    <skipped_module name="nuget.projectmodel.dll" path="nuget.projectmodel.dll" reason="no_symbols" />
    <skipped_module name="system.threading.threadpool.dll" path="system.threading.threadpool.dll" reason="no_symbols" />
    <skipped_module name="system.io.pipes.dll" path="system.io.pipes.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.nugetsdkresolver.dll" path="microsoft.build.nugetsdkresolver.dll" reason="no_symbols" />
    <skipped_module name="system.io.filesystem.dll" path="system.io.filesystem.dll" reason="no_symbols" />
    <skipped_module name="microsoft.net.sdk.workloadmsbuildsdkresolver.dll" path="microsoft.net.sdk.workloadmsbuildsdkresolver.dll" reason="no_symbols" />
    <skipped_module name="microsoft.net.sdk.workloadmanifestreader.dll" path="microsoft.net.sdk.workloadmanifestreader.dll" reason="no_symbols" />
    <skipped_module name="nuget.frameworks.dll" path="nuget.frameworks.dll" reason="no_symbols" />
    <skipped_module name="system.diagnostics.tracesource.dll" path="system.diagnostics.tracesource.dll" reason="no_symbols" />
    <skipped_module name="system.threading.overlapped.dll" path="system.threading.overlapped.dll" reason="no_symbols" />
    <skipped_module name="microsoft.net.build.tasks.dll" path="microsoft.net.build.tasks.dll" reason="no_symbols" />
    <skipped_module name="nuget.packaging.dll" path="nuget.packaging.dll" reason="no_symbols" />
    <skipped_module name="nuget.librarymodel.dll" path="nuget.librarymodel.dll" reason="no_symbols" />
    <skipped_module name="nuget.versioning.dll" path="nuget.versioning.dll" reason="no_symbols" />
    <skipped_module name="nuget.dependencyresolver.core.dll" path="nuget.dependencyresolver.core.dll" reason="no_symbols" />
    <skipped_module name="newtonsoft.json.dll" path="newtonsoft.json.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.serialization.primitives.dll" path="system.runtime.serialization.primitives.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.numerics.dll" path="system.runtime.numerics.dll" reason="no_symbols" />
    <skipped_module name="system.linq.expressions.dll" path="system.linq.expressions.dll" reason="no_symbols" />
    <skipped_module name="system.componentmodel.typeconverter.dll" path="system.componentmodel.typeconverter.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.build.dll" path="microsoft.testplatform.build.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.metadata.dll" path="system.reflection.metadata.dll" reason="no_symbols" />
    <skipped_module name="system.io.memorymappedfiles.dll" path="system.io.memorymappedfiles.dll" reason="no_symbols" />
    <skipped_module name="system.resources.extensions.dll" path="system.resources.extensions.dll" reason="no_symbols" />
    <skipped_module name="system.resources.writer.dll" path="system.resources.writer.dll" reason="no_symbols" />
    <skipped_module name="microsoft.build.tasks.codeanalysis.dll" path="microsoft.build.tasks.codeanalysis.dll" reason="no_symbols" />
    <skipped_module name="system.codedom.dll" path="system.codedom.dll" reason="no_symbols" />
    <skipped_module name="system.collections.specialized.dll" path="system.collections.specialized.dll" reason="no_symbols" />
    <skipped_module name="sonarscanner.msbuild.tasks.dll" path="sonarscanner.msbuild.tasks.dll" reason="no_symbols" />
    <skipped_module name="sonarscanner.msbuild.common.dll" path="sonarscanner.msbuild.common.dll" reason="no_symbols" />
    <skipped_module name="system.xml.xmlserializer.dll" path="system.xml.xmlserializer.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.emit.dll" path="system.reflection.emit.dll" reason="no_symbols" />
    <skipped_module name="microsoft.extensions.dependencymodel.dll" path="microsoft.extensions.dependencymodel.dll" reason="no_symbols" />
    <skipped_module name="system.text.encodings.web.dll" path="system.text.encodings.web.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.intrinsics.dll" path="system.runtime.intrinsics.dll" reason="no_symbols" />
  </skipped_modules>
</results>

I’m using this parameter to inform where is the coverage file: /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
Should I change this?

The problem is that the coverage file does not contain any details about the function calls. As you can notice all the modules are skipped.

I’ve noticed that you use the same pattern as described here: .NET Test Coverage | SonarCloud Docs and this should work fine.

I’ve also cloned your project and tried on my local machine, and the coverage.xml file looks completely different. All the coverage details are present.

I think the problem on the machine is this:

error MSB3073: The command "xmldocmd ValidatorDotNet.dll ..\..\..\..\Docs --obsolete --quiet --newline lf" exited with code 9009.

Source: trying to make sonarcloud work here. · brenordv/validator-dot-net@f0036f4 · GitHub

Due to this the build fails and the test don’t run properly → coverage.xml is not containing proper info.

Installing the tool before the build should fix the problem:

dotnet tool install xmldocmd -g

Not related to the problem at hand but I’ve also noticed that in the yml file the dotnet-coverage is installed twice:

1 Like

That solved the problem.

thank you very much!

(also thanks for pointing out that I was installing dotnet-coverage twice. fixed that too)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.