Code Coverage 0% (.Net 6 C#, xUnit, GitHub-Actions on SonarCloud)

  • ALM used: GitHub
  • CI system used: GitHub-Actions
  • Languages of the repository: C# (.Net 6)

I’m having trouble getting my CI to go through SonarCloud’s Quality Gate.

When the start build is started after the PR, the “SonarCloud Code Analysis” is already as a failure even before the CI ends. (Really, i can’t understand it)

And since the CI ends successfully, I get the message that the coverage is 0%. What I don’t understand is that: I have my test project, the tests are run in CI, and I still get this message and I can’t evolve my code.

GitHub-Action

name: Build
on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Build
    runs-on: windows-latest
    steps:
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 1.11
          
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
          
      - name: Cache SonarCloud packages
        uses: actions/cache@v1
        with:
          path: ~\sonar\cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
          
      - name: Cache SonarCloud scanner
        id: cache-sonar-scanner
        uses: actions/cache@v1
        with:
          path: .\.sonar\scanner
          key: ${{ runner.os }}-sonar-scanner
          restore-keys: ${{ runner.os }}-sonar-scanner
          
      - name: Install SonarCloud scanner
        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
        shell: pwsh
        run: |
          New-Item -Path .\.sonar\scanner -ItemType Directory
          dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
          
      - name: Build and analyze
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        shell: pwsh
        run: |
          .\.sonar\scanner\dotnet-sonarscanner begin /k:"reginaldovillela_PowerXtensions.DotNet" /o:"reginaldovillela" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.xunit.reportsPaths="**\coverage.cobertura.xml"
          
          dotnet build Src\PowerXtensions.DotNet.sln --configuration Release;
          
          dotnet test Src\PowerXtensions.DotNet.sln --no-build --collect:"XPlat Code Coverage";
          
          .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

Log

Run .\.sonar\scanner\dotnet-sonarscanner begin /k:"reginaldovillela_PowerXtensions.DotNet" /o:"reginaldovillela" /d:sonar.login="***" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.xunit.reportsPaths="**\coverage.cobertura.xml"
  .\.sonar\scanner\dotnet-sonarscanner begin /k:"reginaldovillela_PowerXtensions.DotNet" /o:"reginaldovillela" /d:sonar.login="***" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.xunit.reportsPaths="**\coverage.cobertura.xml"
  
  dotnet build Src\PowerXtensions.DotNet.sln --configuration Release;
  
  dotnet test Src\PowerXtensions.DotNet.sln --no-build --collect:"XPlat Code Coverage";
  
  .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="***"
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    JAVA_HOME_11.0.14_x64: C:\hostedtoolcache\windows\jdk\11.0.14\x64
    JAVA_HOME: C:\hostedtoolcache\windows\jdk\11.0.14\x64
    JAVA_HOME_11_0_14_X64: C:\hostedtoolcache\windows\jdk\11.0.14\x64
    GITHUB_TOKEN: ***
    SONAR_TOKEN: ***
SonarScanner for MSBuild 5.5.3
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
14:54:46.798  Updating build integration targets...
14:54:49.654  Fetching analysis configuration settings...
14:54:50.732  Provisioning analyzer assemblies for cs...
14:54:50.733  Installing required Roslyn analyzers...
14:54:53.085  Provisioning analyzer assemblies for vbnet...
14:54:53.085  Installing required Roslyn analyzers...
14:54:53.167  Pre-processing succeeded.

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.200

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\PowerXtensions.DotNet.csproj (in 21.44 sec).
  Restored D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\PowerXtensions.DotNet.Tests.csproj (in 1.95 min).
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net45\PowerXtensions.DotNet.dll
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net451\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net452\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net46\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net6.0\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net461\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\StringExtensionTests.cs(134,25): warning CS8604: Possible null reference argument for parameter 'value' in 'bool StringExtension.IsNullOrEmptyOrWhiteSpace(string value)'. [D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\PowerXtensions.DotNet.Tests.csproj]
  PowerXtensions.DotNet.Tests -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\bin\Release\net6.0\PowerXtensions.DotNet.Tests.dll
  Sonar: (PowerXtensions.DotNet.Tests.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net462\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net47\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net471\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net472\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net48\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\netstandard2.1\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\netcoreapp3.1\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully
  PowerXtensions.DotNet -> D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet\bin\Release\net5.0\PowerXtensions.DotNet.dll
  Sonar: (PowerXtensions.DotNet.csproj) Project processed successfully

Build succeeded.

D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\StringExtensionTests.cs(134,25): warning CS8604: Possible null reference argument for parameter 'value' in 'bool StringExtension.IsNullOrEmptyOrWhiteSpace(string value)'. [D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\PowerXtensions.DotNet.Tests.csproj]
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:04:56.98
Test run for D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\bin\Debug\net6.0\PowerXtensions.DotNet.Tests.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.1.0
Copyright (c) Microsoft Corporation.  All rights reserved.

The test source file "D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\bin\Debug\net6.0\PowerXtensions.DotNet.Tests.dll" provided was not found.
SonarScanner for MSBuild 5.5.3
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
15:00:00.14  15:00:00.14  WARNING: File 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\README.md' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\microsoft.net.test.sdk\16.11.0\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.Program.cs' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\microsoft.testplatform.testhost\16.11.0\build\netcoreapp2.1\x64\testhost.exe' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\microsoft.testplatform.testhost\16.11.0\build\netcoreapp2.1\x64\testhost.dll' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\microsoft.testplatform.testhost\16.11.0\build\netcoreapp2.1\x64\Microsoft.TestPlatform.PlatformAbstractions.dll' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.visualstudio.dotnetcore.testadapter.dll' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.14  15:00:00.14  WARNING: File 'C:\Users\runneradmin\.nuget\packages\xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.reporters.netcoreapp10.dll' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
15:00:00.141  15:00:00.141  WARNING: File 'C:\Users\runneradmin\.nuget\packages\xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.utility.netcoreapp10.dll' is not located under the root directory 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src' and will not be analyzed.
Calling the SonarScanner CLI...
INFO: Scanner configuration file: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonar\scanner\.store\dotnet-sonarscanner\5.5.3\dotnet-sonarscanner\5.5.3\tools\net5.0\any\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.14 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\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonar\scanner\.store\dotnet-sonarscanner\5.5.3\dotnet-sonarscanner\5.5.3\tools\net5.0\any\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.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=591ms
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=154ms
INFO: Load/download plugins (done) | time=31572ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Github Actions'
INFO: Load project settings for component key: 'reginaldovillela_PowerXtensions.DotNet'
INFO: Load project settings for component key: 'reginaldovillela_PowerXtensions.DotNet' (done) | time=107ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=59ms
INFO: Project key: reginaldovillela_PowerXtensions.DotNet
INFO: Base dir: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src
INFO: Working dir: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar
INFO: Load project branches
INFO: Load project branches (done) | time=142ms
INFO: Check ALM binding of project 'reginaldovillela_PowerXtensions.DotNet'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'reginaldovillela_PowerXtensions.DotNet' (done) | time=100ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=102ms
INFO: Load branch configuration
INFO: Github event: pull_request
INFO: Auto-configuring pull request 4
INFO: Load branch configuration (done) | time=667ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=166ms
INFO: Load active rules
INFO: Load active rules (done) | time=3930ms
INFO: Organization key: reginaldovillela
INFO: Pull request 4 for merge into main from v2.0.0
INFO: Load project repositories
INFO: Load project repositories (done) | time=116ms
INFO: SCM collecting changed files in the branch
INFO: SCM collecting changed files in the branch (done) | time=512ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'PowerXtensions.DotNet.Tests'
INFO:   Base dir: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests
INFO:   Test paths: DateTimeExtensionTests.cs, StringExtensionTests.cs
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'PowerXtensions.DotNet'
INFO:   Base dir: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet
INFO:   Source paths: DateTimeExtension.cs, StringExtension.cs, Assets/icon.png, As...
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: Indexing files of module 'reginaldovillela_PowerXtensions.DotNet'
INFO:   Base dir: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src
INFO:   Excluded sources: **/build-wrapper-dump.json
INFO: 6 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 PowerXtensions.DotNet.Tests
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=110ms
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.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=8ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=2ms
INFO: Sensor Text Sensor [text]
INFO: 2 source files to be analyzed
INFO: 2/2 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=21ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=19ms
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=3ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
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=5ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
INFO: ------------- Run sensors on module PowerXtensions.DotNet
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Roslyn version: 4.1.0.0
INFO: Language version: CSharp10
INFO: Concurrent execution: disabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=17ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=4ms
INFO: Sensor HTML [web]
INFO: Sensor HTML is restricted to changed files only
INFO: Sensor HTML [web] (done) | time=5ms
INFO: Sensor Text Sensor [text]
INFO: 2 source files to be analyzed
INFO: 2/2 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=6ms
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: Sensor CSS Rules is restricted to changed files only
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=0ms
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: ------------- Run sensors on module reginaldovillela_PowerXtensions.DotNet
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
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 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=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=0ms
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=4ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules is restricted to changed files only
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=0ms
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=1ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=6ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=347ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.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\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\.sonar\ucfg2\js
INFO: No UCFGs have been included for analysis.
INFO: Sensor JsSecuritySensor [security] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\6\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\0\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\1\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\2\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\3\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\5\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\7\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\8\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\9\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\10\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\11\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\14\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\4\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\13\output-cs'
INFO: Importing results from 6 proto files in 'D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\.sonarqube\out\12\output-cs'
INFO: Importing 15 Roslyn reports
INFO: Found 2 MSBuild C# projects: 1 MAIN project. 1 TEST project.
INFO: Sensor C# [csharp] (done) | time=335ms
INFO: Sensor C# Unit Test Results Import [csharp]
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=41ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=15ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 4 source files to be analyzed
INFO: SCM Publisher 4/4 source files have been analyzed (done) | time=228ms
INFO: CPD Executor Calculating CPD for 2 files
INFO: CPD Executor CPD calculation finished (done) | time=15ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=65ms
INFO: Analysis report generated in 614ms, dir size=245 KB
INFO: Analysis report compressed in 31ms, zip size=55 KB
INFO: Analysis report uploaded in 374ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=reginaldovillela_PowerXtensions.DotNet&pullRequest=4
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=AX9vMnvlvH_lYgxr5nOh
INFO: Analysis total time: 17.024 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 53.600s
INFO: Final Memory: 34M/117M
INFO: ------------------------------------------------------------------------
The SonarScanner CLI has finished
15:00:54.588  Post-processing succeeded.

Could anyone help me understand the problem?

Thanks.

Hey there.

Two points:

  1. I’m not sure your tests actually ran, based on this message in the logs:

The test source file “D:\a\PowerXtensions.DotNet\PowerXtensions.DotNet\Src\PowerXtensions.DotNet.Tests\bin\Debug\net6.0\PowerXtensions.DotNet.Tests.dll” provided was not found.

  1. sonar.cs.xunit.reportsPaths is used for Test Exeuction data, not coverage data. I would suggest reading the documentation on .NET Test Coverage and the supported formats (vscoveragexml, dotcover, and opencover)

Hey Colin.

thanks for the help.

Missed adding a package to the project.

Best Regards

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