Sonar Qube coverage is down its very different from what i calculating locally using code cover

I am facing a same kind of issue the sonar scanner is giving me totally wrong calculated results when i test my code coverage locally its giving 90 percent coverage but sonar gives me 6 percent.
i have checked in artifacts we have .trx file and we already have all the tests but still its not calculating the correct coverage
image
image

Hi,

It’s not clear to me whether that screenshot is of new or overall measures.

But this dusty-but-still-relevant blog post may be helpful.

 
Ann

it is related to new code in one of my service its not calculating the code coverage correctly.
i have added a test class with 100 percent code code coverage but when i run the pipeline the sonar qube gives me 0 percent coverage.
sonar qube command:
sonarQubeCommand = “”"dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin /k:${applicationName} /version:${dotnetVersion}
/d:sonar.cs.vstest.reportsPaths=‘${unitTestsReportPathPath}*.trx’
/d:sonar.cs.opencover.reportsPaths=‘${unitTestsReportPathPath}coverage.opencover.xml’
/d:sonar.cs.opencover.it.reportsPaths=‘${integrationTestsReportPath}coverage.opencover.xml’ \

Test class:

public class SonarCoverageDemo
{
    public int Sum(int a, int b)
    {
        return a + b;
    }

    public int Difference(int a, int b)
    {
        return a - b;
    }

    public int Multiply(int a, int b)
    {
        return a * b;
    }

    public int Multiply2(int a, int b)
    {
        return a * b;
    }

    public int Difference2(int a, int b)
    {
        return a - b;
    }

    public double Divide(int a, int b)
    {
        if (b == 0)
            throw new ArgumentException("Division by zero is not allowed");

        return (double)a / b;
    }
}

Unit Tests:
public class SonarCoverageDemoTests
{
private readonly SonarCoverageDemo _sut;
public SonarCoverageDemoTests()
{
_sut = new SonarCoverageDemo();

    }
    [Fact]
    public void Sum_Returns_Correct_Result()
    {
        // Arrange
        var a = 5;
        var b = 3;
        var expectedSum = 8;

        // Act
        var result = _sut.Sum(a, b);

        // Assert
        Assert.Equal(expectedSum, result);
    }

    [Fact]
    public void Difference_Returns_Correct_Result()
    {
        // Arrange
        var a = 5;
        var b = 3;
        var expectedDifference = 2;

        // Act
        var result = _sut.Difference(a, b);


        // Assert
        Assert.Equal(expectedDifference, result);
    }

    [Fact]
    public void Multiply_Returns_Correct_Result()
    {
        // Arrange
        var a = 5;
        var b = 3;
        var expectedProduct = 15;

        // Act
        var result = _sut.Multiply(a, b);

        // Assert
        Assert.Equal(expectedProduct, result);
    }

    [Fact]
    public void Difference2_Returns_Correct_Result()
    {
        // Arrange
        var a = 5;
        var b = 3;
        var expectedDifference = 2;

        // Act
        var result = _sut.Difference2(a, b);


        // Assert
        Assert.Equal(expectedDifference, result);
    }

    [Fact]
    public void Multiply2_Returns_Correct_Result()
    {
        // Arrange
        var a = 5;
        var b = 3;
        var expectedProduct = 15;

        // Act
        var result = _sut.Multiply2(a, b);

        // Assert
        Assert.Equal(expectedProduct, result);
    }

    [Fact]
    public void Divide_Returns_Correct_Result()
    {
        // Arrange
        var a = 10;

        var b = 2;
        double expectedQuotient = 5.0;

        // Act
        double result = _sut.Divide(a, b);

        // Assert
        Assert.Equal(expectedQuotient, result);
    }

    [Fact]
    public void Divide_Throws_Exception_When_Dividing_By_Zero()
    {
        // Arrange
        var a = 10;
        var b = 0;


        // Act & Assert
        Assert.Throws<ArgumentException>(() => _sut.Divide(a, b));
    }
}

Sonar qube result

Hi,

At a guess, your coverage report wasn’t read. Can you share your analysis log?

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"
    • “SonarQubePrepare” or “SonarCloudPrepare” task’s extraProperties argument if you are using Azure DevOps
      • For example:
        - task: SonarCloudPrepare@1
            inputs:
              SonarCloud: 'sonarcloud'
              organization: 'foo'
              scannerMode: 'MSBuild'
              projectKey: 'foo_sonar-scanning-someconsoleapp'
              projectName: 'sonar-scanning-someconsoleapp'
              extraProperties: |
                sonar.verbose=true
        
  • The important logs are in the END step (i.e. SonarQubeAnalyze / SonarCloudAnalyze / “Run Code Analysis”)

Share the msbuild detailed logs

MsBuild.exe /t:Rebuild /v:d

or

dotnet build -v:d

 
Ann

**dotnet /sonar-scanner/SonarScanner.MSBuild.dll**
[2024-04-16T11:02:32.118Z] + dotnet /sonar-scanner/SonarScanner.MSBuild.dll end
[2024-04-16T11:02:32.219Z] SonarScanner for MSBuild 6.0
[2024-04-16T11:02:32.219Z] Using the .NET Core version of the Scanner for MSBuild
[2024-04-16T11:02:32.320Z] Post-processing started.
[2024-04-16T11:02:32.521Z] Calling the SonarScanner CLI...
[2024-04-16T11:02:32.823Z] INFO: Scanner configuration file: /sonar-scanner/sonar-scanner-5.0.1.3006/conf/sonar-scanner.properties
[2024-04-16T11:02:32.823Z] INFO: Project root configuration file: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/sonar-project.properties
[2024-04-16T11:02:32.924Z] INFO: SonarScanner 5.0.1.3006
[2024-04-16T11:02:32.924Z] INFO: Java 17.0.9 Debian (64-bit)
[2024-04-16T11:02:32.924Z] INFO: Linux 4.4.169-1.el7.elrepo.x86_64 amd64
[2024-04-16T11:02:33.430Z] INFO: User cache: /root/.sonar/cache
[2024-04-16T11:02:35.041Z] INFO: Analyzing on SonarQube server 9.9.1.69595
[2024-04-16T11:02:35.041Z] INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
[2024-04-16T11:02:35.645Z] INFO: Load global settings
[2024-04-16T11:02:35.947Z] INFO: Load global settings (done) | time=232ms
[2024-04-16T11:02:35.947Z] INFO: Server id: 4CD03DD4-AYoh1NSGNfJYVq9KeyTa
[2024-04-16T11:02:35.948Z] INFO: User cache: /root/.sonar/cache
[2024-04-16T11:02:35.948Z] INFO: Load/download plugins
[2024-04-16T11:02:35.948Z] INFO: Load plugins index
[2024-04-16T11:02:35.948Z] INFO: Load plugins index (done) | time=48ms
[2024-04-16T11:02:38.366Z] INFO: Load/download plugins (done) | time=2455ms
[2024-04-16T11:02:38.869Z] INFO: Loaded core extensions: developer-scanner
[2024-04-16T11:02:39.374Z] INFO: Process project properties
[2024-04-16T11:02:39.374Z] INFO: Process project properties (done) | time=24ms
[2024-04-16T11:02:39.374Z] INFO: Execute project builders
[2024-04-16T11:02:39.374Z] INFO: Execute project builders (done) | time=39ms
[2024-04-16T11:02:39.374Z] INFO: Project key: telco.gco.microservice
[2024-04-16T11:02:39.374Z] INFO: Base dir: /opt/jenkins/workspace/telco.microservices.gco_PR-319
[2024-04-16T11:02:39.375Z] INFO: Working dir: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar
[2024-04-16T11:02:39.476Z] INFO: Load project settings for component key: 'telco.gco.microservice'
[2024-04-16T11:02:39.476Z] INFO: Load project settings for component key: 'telco.gco.microservice' (done) | time=16ms
[2024-04-16T11:02:39.576Z] INFO: Load project branches
[2024-04-16T11:02:39.576Z] INFO: Load project branches (done) | time=14ms
[2024-04-16T11:02:39.576Z] INFO: Load branch configuration
[2024-04-16T11:02:39.576Z] INFO: Found manual configuration of branch/PR analysis. Skipping automatic configuration.
[2024-04-16T11:02:39.576Z] INFO: Load branch configuration (done) | time=4ms
[2024-04-16T11:02:39.677Z] INFO: Auto-configuring with CI 'Jenkins'
[2024-04-16T11:02:39.777Z] INFO: Load quality profiles
[2024-04-16T11:02:39.878Z] INFO: Load quality profiles (done) | time=79ms
[2024-04-16T11:02:39.878Z] INFO: Load active rules
[2024-04-16T11:02:42.993Z] INFO: Load active rules (done) | time=3121ms
[2024-04-16T11:02:42.993Z] INFO: Load analysis cache
[2024-04-16T11:02:43.095Z] INFO: Load analysis cache | time=15ms
[2024-04-16T11:02:43.095Z] INFO: Pull request 319 for merge into master from DSLAPP-9834-SonarQube-CodeCoverageCheck
[2024-04-16T11:02:43.095Z] INFO: Load project repositories
[2024-04-16T11:02:43.196Z] INFO: Load project repositories (done) | time=74ms
[2024-04-16T11:02:43.196Z] INFO: SCM collecting changed files in the branch
[2024-04-16T11:02:43.196Z] INFO: Merge base sha1: 2ba5e79c90554cf10de3609ef2775b485d3ea818
[2024-04-16T11:02:43.397Z] INFO: SCM collecting changed files in the branch (done) | time=182ms
[2024-04-16T11:02:43.397Z] INFO: Indexing files...
[2024-04-16T11:02:43.397Z] INFO: Project configuration:
[2024-04-16T11:02:43.397Z] INFO:   Excluded sources: **/*AssemblyInfo.cs, **/Reference.cs, **/*.designer.cs, **/*.Designer.cs, **/*.g.cs, **/*.generated.cs, **/Service References/**, **/GeneratedCode/**, **/GeneratedContent/**, **/*.min.*, **/Content/libs/**, **/Test/**
[2024-04-16T11:02:43.397Z] INFO:   Excluded sources for coverage: **/*.aspx.cs, **/*.ascx.cs, **/*.asax.cs, **/AssemblyInfo.cs, **/FeatureToggle.cs
[2024-04-16T11:02:43.397Z] INFO:   Excluded sources for duplication: **/GeneratedContent/**, **/AssemblyInfo.cs
[2024-04-16T11:02:43.498Z] INFO: Indexing files of module 'telco.gco.microservice.tests'
[2024-04-16T11:02:43.498Z] INFO:   Base dir: /opt/jenkins/workspace/telco.microservices.gco_PR-319/telco.gco.microservice.tests
[2024-04-16T11:02:43.498Z] INFO:   Test paths: Extensions/Extensions.cs, Helpers/BaseTest.cs, Helpers/TestHelp...
[2024-04-16T11:02:43.498Z] INFO:   Excluded sources: **/*AssemblyInfo.cs, **/Reference.cs, **/*.designer.cs, **/*.Designer.cs, **/*.g.cs, **/*.generated.cs, **/Service References/**, **/GeneratedCode/**, **/GeneratedContent/**, **/*.min.*, **/Content/libs/**, **/Test/**
[2024-04-16T11:02:43.498Z] INFO:   Excluded sources for coverage: **/*.aspx.cs, **/*.ascx.cs, **/*.asax.cs, **/AssemblyInfo.cs, **/FeatureToggle.cs
[2024-04-16T11:02:43.498Z] INFO:   Excluded sources for duplication: **/GeneratedContent/**, **/AssemblyInfo.cs
[2024-04-16T11:02:43.699Z] INFO: Indexing files of module 'telco.gco.microservice'
[2024-04-16T11:02:43.699Z] INFO:   Base dir: /opt/jenkins/workspace/telco.microservices.gco_PR-319/telco.gco.microservice
[2024-04-16T11:02:43.699Z] INFO:   Source paths: Cache/CachedAttribute.cs, Cache/RedisCacheSettings.cs, Contro...
[2024-04-16T11:02:43.699Z] INFO:   Excluded sources: **/*AssemblyInfo.cs, **/Reference.cs, **/*.designer.cs, **/*.Designer.cs, **/*.g.cs, **/*.generated.cs, **/Service References/**, **/GeneratedCode/**, **/GeneratedContent/**, **/*.min.*, **/Content/libs/**, **/Test/**
[2024-04-16T11:02:43.699Z] INFO:   Excluded sources for coverage: **/*.aspx.cs, **/*.ascx.cs, **/*.asax.cs, **/AssemblyInfo.cs, **/FeatureToggle.cs
[2024-04-16T11:02:43.699Z] INFO:   Excluded sources for duplication: **/GeneratedContent/**, **/AssemblyInfo.cs
[2024-04-16T11:02:43.800Z] INFO: Indexing files of module 'telco.gco.microservice'
[2024-04-16T11:02:43.800Z] INFO:   Base dir: /opt/jenkins/workspace/telco.microservices.gco_PR-319
[2024-04-16T11:02:43.800Z] INFO:   Source paths: .dockerignore
[2024-04-16T11:02:43.800Z] INFO:   Excluded sources: **/*AssemblyInfo.cs, **/Reference.cs, **/*.designer.cs, **/*.Designer.cs, **/*.g.cs, **/*.generated.cs, **/Service References/**, **/GeneratedCode/**, **/GeneratedContent/**, **/*.min.*, **/Content/libs/**, **/Test/**
[2024-04-16T11:02:43.800Z] INFO:   Excluded sources for coverage: **/*.aspx.cs, **/*.ascx.cs, **/*.asax.cs, **/AssemblyInfo.cs, **/FeatureToggle.cs
[2024-04-16T11:02:43.800Z] INFO:   Excluded sources for duplication: **/GeneratedContent/**, **/AssemblyInfo.cs
[2024-04-16T11:02:43.800Z] INFO: 390 files indexed
[2024-04-16T11:02:43.800Z] INFO: 2 files ignored because of inclusion/exclusion patterns
[2024-04-16T11:02:43.800Z] INFO: 2 files ignored because of scm ignore settings
[2024-04-16T11:02:43.900Z] INFO: Quality profile for cs: Sonar way
[2024-04-16T11:02:43.900Z] INFO: Quality profile for json: Sonar way
[2024-04-16T11:02:43.900Z] INFO: ------------- Run sensors on module telco.gco.microservice
[2024-04-16T11:02:44.001Z] INFO: Load metrics repository
[2024-04-16T11:02:44.001Z] INFO: Load metrics repository (done) | time=18ms
[2024-04-16T11:02:46.518Z] INFO: Sensor IaC CloudFormation Sensor [iac]
[2024-04-16T11:02:46.619Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:46.619Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:46.619Z] INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=115ms
[2024-04-16T11:02:46.619Z] INFO: Sensor IaC Kubernetes Sensor [iac]
[2024-04-16T11:02:46.619Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:46.719Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:46.719Z] INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=46ms
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Project Type Information [csharp]
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Analysis Log [csharp]
[2024-04-16T11:02:46.720Z] INFO: Roslyn version: 4.8.0.0
[2024-04-16T11:02:46.720Z] INFO: Language version: CSharp12
[2024-04-16T11:02:46.720Z] INFO: Concurrent execution: enabled
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Analysis Log [csharp] (done) | time=5ms
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Properties [csharp]
[2024-04-16T11:02:46.720Z] INFO: Sensor C# Properties [csharp] (done) | time=1ms
[2024-04-16T11:02:46.720Z] INFO: Sensor HTML [web]
[2024-04-16T11:02:46.720Z] INFO: Sensor HTML is restricted to changed files only
[2024-04-16T11:02:46.720Z] INFO: Sensor HTML [web] (done) | time=4ms
[2024-04-16T11:02:46.720Z] INFO: Sensor TextAndSecretsSensor [text]
[2024-04-16T11:02:46.720Z] INFO: Sensor TextAndSecretsSensor is restricted to changed files only
[2024-04-16T11:02:46.921Z] INFO: 1 source file to be analyzed
[2024-04-16T11:02:46.921Z] INFO: 1/1 source file has been analyzed
[2024-04-16T11:02:46.921Z] INFO: Sensor TextAndSecretsSensor [text] (done) | time=229ms
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Project Type Information [vbnet]
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Analysis Log [vbnet]
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=14ms
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Properties [vbnet]
[2024-04-16T11:02:46.921Z] INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
[2024-04-16T11:02:46.921Z] INFO: Sensor JaCoCo XML Report Importer [jacoco]
[2024-04-16T11:02:46.921Z] 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
[2024-04-16T11:02:46.921Z] INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[2024-04-16T11:02:46.921Z] INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
[2024-04-16T11:02:46.921Z] INFO: Sensor CSS Rules [javascript]
[2024-04-16T11:02:46.921Z] INFO: Sensor CSS Rules is restricted to changed files only
[2024-04-16T11:02:46.921Z] INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[2024-04-16T11:02:46.921Z] INFO: Sensor CSS Rules [javascript] (done) | time=0ms
[2024-04-16T11:02:46.921Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
[2024-04-16T11:02:46.922Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
[2024-04-16T11:02:46.922Z] INFO: Sensor IaC Docker Sensor [iac]
[2024-04-16T11:02:46.922Z] INFO: Sensor IaC Docker Sensor is restricted to changed files only
[2024-04-16T11:02:46.922Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:47.022Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:47.022Z] INFO: Sensor IaC Docker Sensor [iac] (done) | time=51ms
[2024-04-16T11:02:47.022Z] INFO: Sensor Serverless configuration file sensor [security]
[2024-04-16T11:02:47.023Z] INFO: 0 Serverless function entries were found in the project
[2024-04-16T11:02:47.023Z] INFO: 0 Serverless function handlers were kept as entrypoints
[2024-04-16T11:02:47.023Z] INFO: Sensor Serverless configuration file sensor [security] (done) | time=3ms
[2024-04-16T11:02:47.023Z] INFO: Sensor AWS SAM template file sensor [security]
[2024-04-16T11:02:47.023Z] INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
[2024-04-16T11:02:47.023Z] INFO: Sensor AWS SAM Inline template file sensor [security]
[2024-04-16T11:02:47.023Z] INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
[2024-04-16T11:02:47.023Z] INFO: ------------- Run sensors on module telco.gco.microservice.tests
[2024-04-16T11:02:47.224Z] INFO: Sensor IaC CloudFormation Sensor [iac]
[2024-04-16T11:02:47.224Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:47.224Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:47.224Z] INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=1ms
[2024-04-16T11:02:47.224Z] INFO: Sensor IaC Kubernetes Sensor [iac]
[2024-04-16T11:02:47.224Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:47.224Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:47.224Z] INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=1ms
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Project Type Information [csharp]
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Analysis Log [csharp]
[2024-04-16T11:02:47.224Z] INFO: Roslyn version: 4.8.0.0
[2024-04-16T11:02:47.224Z] INFO: Language version: CSharp12
[2024-04-16T11:02:47.224Z] INFO: Concurrent execution: enabled
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Analysis Log [csharp] (done) | time=0ms
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Properties [csharp]
[2024-04-16T11:02:47.224Z] INFO: Sensor C# Properties [csharp] (done) | time=0ms
[2024-04-16T11:02:47.224Z] INFO: Sensor TextAndSecretsSensor [text]
[2024-04-16T11:02:47.224Z] INFO: Sensor TextAndSecretsSensor is restricted to changed files only
[2024-04-16T11:02:47.224Z] WARN: Invalid character encountered in file /opt/jenkins/workspace/telco.microservices.gco_PR-319/telco.gco.microservice.tests/offerData.json at line 22 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
[2024-04-16T11:02:47.325Z] INFO: 1 source file to be analyzed
[2024-04-16T11:02:47.325Z] INFO: 1/1 source file has been analyzed
[2024-04-16T11:02:47.325Z] INFO: Sensor TextAndSecretsSensor [text] (done) | time=94ms
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Project Type Information [vbnet]
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Analysis Log [vbnet]
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Properties [vbnet]
[2024-04-16T11:02:47.325Z] INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor JaCoCo XML Report Importer [jacoco]
[2024-04-16T11:02:47.325Z] 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
[2024-04-16T11:02:47.325Z] INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[2024-04-16T11:02:47.325Z] INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor CSS Rules [javascript]
[2024-04-16T11:02:47.325Z] INFO: Sensor CSS Rules is restricted to changed files only
[2024-04-16T11:02:47.325Z] INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[2024-04-16T11:02:47.325Z] INFO: Sensor CSS Rules [javascript] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
[2024-04-16T11:02:47.325Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor IaC Docker Sensor [iac]
[2024-04-16T11:02:47.325Z] INFO: Sensor IaC Docker Sensor is restricted to changed files only
[2024-04-16T11:02:47.325Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:47.325Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:47.325Z] INFO: Sensor IaC Docker Sensor [iac] (done) | time=12ms
[2024-04-16T11:02:47.325Z] INFO: Sensor Serverless configuration file sensor [security]
[2024-04-16T11:02:47.325Z] INFO: 0 Serverless function entries were found in the project
[2024-04-16T11:02:47.325Z] INFO: 0 Serverless function handlers were kept as entrypoints
[2024-04-16T11:02:47.325Z] INFO: Sensor Serverless configuration file sensor [security] (done) | time=1ms
[2024-04-16T11:02:47.325Z] INFO: Sensor AWS SAM template file sensor [security]
[2024-04-16T11:02:47.325Z] INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: Sensor AWS SAM Inline template file sensor [security]
[2024-04-16T11:02:47.325Z] INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=0ms
[2024-04-16T11:02:47.325Z] INFO: ------------- Run sensors on module telco.gco.microservice
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Project Type Information [csharp]
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Analysis Log [csharp]
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Analysis Log [csharp] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Properties [csharp]
[2024-04-16T11:02:47.628Z] INFO: Sensor C# Properties [csharp] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor HTML [web]
[2024-04-16T11:02:47.628Z] INFO: Sensor HTML is restricted to changed files only
[2024-04-16T11:02:47.628Z] INFO: Sensor HTML [web] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor TextAndSecretsSensor [text]
[2024-04-16T11:02:47.628Z] INFO: Sensor TextAndSecretsSensor is restricted to changed files only
[2024-04-16T11:02:47.628Z] INFO: Sensor TextAndSecretsSensor [text] (done) | time=1ms
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Project Type Information [vbnet]
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Analysis Log [vbnet]
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Properties [vbnet]
[2024-04-16T11:02:47.628Z] INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
[2024-04-16T11:02:47.628Z] INFO: Sensor JaCoCo XML Report Importer [jacoco]
[2024-04-16T11:02:47.628Z] 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
[2024-04-16T11:02:47.628Z] INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[2024-04-16T11:02:47.629Z] INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
[2024-04-16T11:02:47.629Z] INFO: Sensor CSS Rules [javascript]
[2024-04-16T11:02:47.629Z] INFO: Sensor CSS Rules is restricted to changed files only
[2024-04-16T11:02:47.629Z] INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[2024-04-16T11:02:47.629Z] INFO: Sensor CSS Rules [javascript] (done) | time=0ms
[2024-04-16T11:02:47.629Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
[2024-04-16T11:02:47.629Z] INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
[2024-04-16T11:02:47.629Z] INFO: Sensor IaC Docker Sensor [iac]
[2024-04-16T11:02:47.629Z] INFO: Sensor IaC Docker Sensor is restricted to changed files only
[2024-04-16T11:02:47.629Z] INFO: 0 source files to be analyzed
[2024-04-16T11:02:47.629Z] INFO: 0/0 source files have been analyzed
[2024-04-16T11:02:47.629Z] INFO: Sensor IaC Docker Sensor [iac] (done) | time=8ms
[2024-04-16T11:02:47.629Z] INFO: Sensor Serverless configuration file sensor [security]
[2024-04-16T11:02:47.629Z] INFO: 0 Serverless function entries were found in the project
[2024-04-16T11:02:47.629Z] INFO: 0 Serverless function handlers were kept as entrypoints
[2024-04-16T11:02:47.629Z] INFO: Sensor Serverless configuration file sensor [security] (done) | time=0ms
[2024-04-16T11:02:47.629Z] INFO: Sensor AWS SAM template file sensor [security]
[2024-04-16T11:02:47.629Z] INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
[2024-04-16T11:02:47.629Z] INFO: Sensor AWS SAM Inline template file sensor [security]
[2024-04-16T11:02:47.629Z] INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=0ms
[2024-04-16T11:02:47.629Z] INFO: Sensor javabugs [dbd]
[2024-04-16T11:02:47.629Z] INFO: Reading IR files from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ir/java
[2024-04-16T11:02:47.629Z] INFO: No IR files have been included for analysis.
[2024-04-16T11:02:47.629Z] INFO: Sensor javabugs [dbd] (done) | time=1ms
[2024-04-16T11:02:47.629Z] INFO: Sensor pythonbugs [dbd]
[2024-04-16T11:02:47.629Z] INFO: Reading IR files from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ir/python
[2024-04-16T11:02:47.629Z] INFO: No IR files have been included for analysis.
[2024-04-16T11:02:47.629Z] INFO: Sensor pythonbugs [dbd] (done) | time=1ms
[2024-04-16T11:02:47.629Z] INFO: Sensor JavaSecuritySensor [security]
[2024-04-16T11:02:47.629Z] INFO: Reading type hierarchy from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ucfg2/java
[2024-04-16T11:02:47.629Z] INFO: Read 0 type definitions
[2024-04-16T11:02:47.629Z] INFO: No UCFGs have been included for analysis.
[2024-04-16T11:02:47.629Z] INFO: Sensor JavaSecuritySensor [security] (done) | time=4ms
[2024-04-16T11:02:47.630Z] INFO: Sensor CSharpSecuritySensor [security]
[2024-04-16T11:02:47.630Z] INFO: Reading type hierarchy from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/ucfg_cs2
[2024-04-16T11:02:47.731Z] INFO: Read 280 type definitions
[2024-04-16T11:02:47.731Z] INFO: Reading UCFGs from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/ucfg_cs2
[2024-04-16T11:02:48.233Z] INFO: 11:02:48.145823867 Building Runtime Type propagation graph
[2024-04-16T11:02:48.233Z] INFO: 11:02:48.221227878 Running Tarjan on 8205 nodes
[2024-04-16T11:02:48.334Z] INFO: 11:02:48.270582495 Tarjan found 7960 components
[2024-04-16T11:02:48.334Z] INFO: 11:02:48.322532734 Variable type analysis: done
[2024-04-16T11:02:48.334Z] INFO: 11:02:48.325741858 Building Runtime Type propagation graph
[2024-04-16T11:02:48.536Z] INFO: 11:02:48.459501169 Running Tarjan on 8205 nodes
[2024-04-16T11:02:48.536Z] INFO: 11:02:48.488140992 Tarjan found 7960 components
[2024-04-16T11:02:48.536Z] INFO: 11:02:48.527618824 Variable type analysis: done
[2024-04-16T11:02:48.536Z] INFO: Analyzing 1676 ucfgs to detect vulnerabilities.
[2024-04-16T11:02:49.340Z] INFO: All rules entrypoints : 3
[2024-04-16T11:02:49.340Z] INFO: Retained UCFGs : 223
[2024-04-16T11:02:49.340Z] INFO: Taint analysis starting. Entrypoints: 3
[2024-04-16T11:02:49.340Z] INFO: Running symbolic analysis for 'CSHARP'
[2024-04-16T11:02:49.842Z] INFO: Taint analysis: done.
[2024-04-16T11:02:49.842Z] INFO: Sensor CSharpSecuritySensor [security] (done) | time=2184ms
[2024-04-16T11:02:49.842Z] INFO: Sensor PhpSecuritySensor [security]
[2024-04-16T11:02:49.842Z] INFO: Reading type hierarchy from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ucfg2/php
[2024-04-16T11:02:49.842Z] INFO: Read 0 type definitions
[2024-04-16T11:02:49.842Z] INFO: No UCFGs have been included for analysis.
[2024-04-16T11:02:49.842Z] INFO: Sensor PhpSecuritySensor [security] (done) | time=0ms
[2024-04-16T11:02:49.842Z] INFO: Sensor PythonSecuritySensor [security]
[2024-04-16T11:02:49.842Z] INFO: Reading type hierarchy from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ucfg2/python
[2024-04-16T11:02:49.842Z] INFO: Read 0 type definitions
[2024-04-16T11:02:49.842Z] INFO: No UCFGs have been included for analysis.
[2024-04-16T11:02:49.842Z] INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
[2024-04-16T11:02:49.842Z] INFO: Sensor JsSecuritySensor [security]
[2024-04-16T11:02:49.842Z] INFO: Reading type hierarchy from: /opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/.sonar/ucfg2/js
[2024-04-16T11:02:49.842Z] INFO: Read 0 type definitions
[2024-04-16T11:02:49.842Z] INFO: No UCFGs have been included for analysis.
[2024-04-16T11:02:49.842Z] INFO: Sensor JsSecuritySensor [security] (done) | time=0ms
[2024-04-16T11:02:49.842Z] INFO: ------------- Run sensors on project
[2024-04-16T11:02:49.842Z] INFO: Sensor C# [csharp]
[2024-04-16T11:02:49.843Z] INFO: Importing results from 6 proto files in '/opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/0/output-cs'
[2024-04-16T11:02:50.144Z] INFO: Importing results from 6 proto files in '/opt/jenkins/workspace/telco.microservices.gco_PR-319/.sonarqube/out/1/output-cs'
[2024-04-16T11:02:50.245Z] INFO: Importing 2 Roslyn reports
[2024-04-16T11:02:50.245Z] INFO: Found 2 MSBuild C# projects: 1 MAIN project. 1 TEST project.
[2024-04-16T11:02:50.245Z] INFO: Sensor C# [csharp] (done) | time=401ms
[2024-04-16T11:02:50.245Z] INFO: Sensor Analysis Warnings import [csharp]
[2024-04-16T11:02:50.245Z] INFO: Sensor Analysis Warnings import [csharp] (done) | time=2ms
[2024-04-16T11:02:50.245Z] INFO: Sensor C# File Caching Sensor [csharp]
[2024-04-16T11:02:50.245Z] INFO: Sensor C# File Caching Sensor [csharp] (done) | time=0ms
[2024-04-16T11:02:50.245Z] INFO: Sensor C# Tests Coverage Report Import [csharp]
[2024-04-16T11:02:50.245Z] INFO: Parsing the OpenCover report /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/coverage.opencover.xml
[2024-04-16T11:02:50.449Z] INFO: Adding this code coverage report to the cache for later reuse: /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/coverage.opencover.xml
[2024-04-16T11:02:50.550Z] INFO: Coverage Report Statistics: 215 files, 215 main files, 215 main files with coverage, 0 test files, 0 project excluded files, 0 other language files.
[2024-04-16T11:02:50.550Z] INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=323ms
[2024-04-16T11:02:50.551Z] INFO: Sensor [Deprecated] C# Integration Tests Coverage Report Import [csharp]
[2024-04-16T11:02:50.551Z] WARN: Starting with SonarQube 6.2 separation between Unit Tests and Integration Tests Coverage reports is deprecated. Please move all reports specified from *.it.reportPaths into *.reportPaths.
[2024-04-16T11:02:50.551Z] INFO: Parsing the OpenCover report /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/integration/coverage.opencover.xml
[2024-04-16T11:02:50.652Z] INFO: Adding this code coverage report to the cache for later reuse: /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/integration/coverage.opencover.xml
[2024-04-16T11:02:50.754Z] INFO: Coverage Report Statistics: 215 files, 215 main files, 215 main files with coverage, 0 test files, 0 project excluded files, 0 other language files.
[2024-04-16T11:02:50.754Z] INFO: Sensor [Deprecated] C# Integration Tests Coverage Report Import [csharp] (done) | time=193ms
[2024-04-16T11:02:50.754Z] INFO: Sensor C# Unit Test Results Import [csharp]
[2024-04-16T11:02:50.754Z] INFO: Parsing the Visual Studio Test Results file '/opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/_bc3b28fb32f9_2024-04-16_11_02_18.trx'.
[2024-04-16T11:02:50.857Z] INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=25ms
[2024-04-16T11:02:50.857Z] INFO: Sensor Dependency-Check [dependencycheck]
[2024-04-16T11:02:50.857Z] INFO: Process Dependency-Check report
[2024-04-16T11:02:50.857Z] INFO: Using JSON-Reportparser
[2024-04-16T11:02:50.857Z] INFO: Dependency-Check JSON report does not exists. Please check property sonar.dependencyCheck.jsonReportPath:/opt/jenkins/workspace/telco.microservices.gco_PR-319/${WORKSPACE}/dependency-check-report.json
[2024-04-16T11:02:50.857Z] INFO: JSON-Analysis skipped/aborted due to missing report file
[2024-04-16T11:02:50.857Z] INFO: Dependency-Check HTML report does not exists. Please check property sonar.dependencyCheck.htmlReportPath:/opt/jenkins/workspace/telco.microservices.gco_PR-319/${WORKSPACE}/dependency-check-report.html
[2024-04-16T11:02:50.857Z] INFO: HTML-Dependency-Check report does not exist.
[2024-04-16T11:02:50.857Z] INFO: Process Dependency-Check report (done) | time=3ms
[2024-04-16T11:02:50.857Z] INFO: Sensor Dependency-Check [dependencycheck] (done) | time=3ms
[2024-04-16T11:02:50.857Z] INFO: Sensor Zero Coverage Sensor
[2024-04-16T11:02:50.857Z] INFO: Sensor Zero Coverage Sensor (done) | time=3ms
[2024-04-16T11:02:50.857Z] INFO: SCM Publisher SCM provider for this project is: git
[2024-04-16T11:02:50.857Z] INFO: SCM Publisher 2 source files to be analyzed
[2024-04-16T11:02:50.857Z] INFO: SCM Publisher 2/2 source files have been analyzed (done) | time=70ms
[2024-04-16T11:02:50.962Z] INFO: CPD Executor 93 files had no CPD blocks
[2024-04-16T11:02:50.962Z] INFO: CPD Executor Calculating CPD for 206 files
[2024-04-16T11:02:50.962Z] INFO: CPD Executor CPD calculation finished (done) | time=77ms
[2024-04-16T11:02:51.163Z] INFO: SCM writing changed lines
[2024-04-16T11:02:51.164Z] INFO: Merge base sha1: 2ba5e79c90554cf10de3609ef2775b485d3ea818
[2024-04-16T11:02:51.164Z] INFO: SCM writing changed lines (done) | time=40ms
[2024-04-16T11:02:51.164Z] INFO: Analysis report generated in 148ms, dir size=297.3 kB
[2024-04-16T11:02:51.365Z] INFO: Analysis report compressed in 227ms, zip size=182.3 kB
[2024-04-16T11:02:51.468Z] INFO: Analysis report uploaded in 31ms
[2024-04-16T11:02:51.468Z] INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://sonar01.verivox.ads/dashboard?id=telco.gco.microservice&pullRequest=319
[2024-04-16T11:02:51.468Z] INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[2024-04-16T11:02:51.468Z] INFO: More about the report processing at http://sonar01.verivox.ads/api/ce/task?id=AY7mkujYNfJYVq9KfDc8
[2024-04-16T11:02:51.468Z] INFO: Analysis total time: 12.576 s
[2024-04-16T11:02:51.468Z] INFO: ------------------------------------------------------------------------
[2024-04-16T11:02:51.468Z] INFO: EXECUTION SUCCESS
[2024-04-16T11:02:51.468Z] INFO: ------------------------------------------------------------------------
[2024-04-16T11:02:51.468Z] INFO: Total time: 18.681s
[2024-04-16T11:02:51.569Z] INFO: Final Memory: 37M/140M
[2024-04-16T11:02:51.569Z] INFO: ------------------------------------------------------------------------
**dotnet test ./telco.gco.microservice.tests/telco.gco.microservice.tests.csproj --no-build -c Release --filter UnitTests --results-directory /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/ --logger trx /p:CollectCoverage=true /p:CoverletOutp**
[2024-04-16T11:02:13.624Z] + dotnet test ./telco.gco.microservice.tests/telco.gco.microservice.tests.csproj --no-build -c Release --filter UnitTests --results-directory /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/ --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=/opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/
[2024-04-16T11:02:16.947Z] Test run for /opt/jenkins/workspace/telco.microservices.gco_PR-319/telco.gco.microservice.tests/bin/Release/net8.0/telco.gco.microservice.tests.dll (.NETCoreApp,Version=v8.0)
[2024-04-16T11:02:17.048Z] Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)
[2024-04-16T11:02:17.048Z] Copyright (c) Microsoft Corporation.  All rights reserved.
[2024-04-16T11:02:17.048Z] 
[2024-04-16T11:02:17.249Z] Starting test execution, please wait...
[2024-04-16T11:02:17.249Z] A total of 1 test files matched the specified pattern.
[2024-04-16T11:02:19.167Z] {"Timestamp":"2024-04-16T11:02:19.0426203+00:00","Level":"Warning","MessageTemplate":"{{{Scope}}} Failed to discover service version, the service version will be omitted.","Properties":{"Scope":"AbstractConfigurationReader (ApmConfiguration)","SourceContext":"Elastic.Apm"}}
[2024-04-16T11:02:19.669Z] Results File: /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/_bc3b28fb32f9_2024-04-16_11_02_18.trx
[2024-04-16T11:02:19.669Z] 
[2024-04-16T11:02:19.669Z] Passed!  - Failed:     0, Passed:   298, Skipped:     0, Total:   298, Duration: 1 s - telco.gco.microservice.tests.dll (net8.0)
[2024-04-16T11:02:19.669Z] 
[2024-04-16T11:02:19.669Z] Calculating coverage result...
[2024-04-16T11:02:19.971Z]   Generating report '/opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/coverage.opencover.xml'
[2024-04-16T11:02:20.273Z] 
[2024-04-16T11:02:20.273Z] +------------------------+------+--------+--------+
[2024-04-16T11:02:20.273Z] | Module                 | Line | Branch | Method |
[2024-04-16T11:02:20.273Z] +------------------------+------+--------+--------+
[2024-04-16T11:02:20.273Z] | telco.gco.microservice | 0%   | 0%     | 0%     |
[2024-04-16T11:02:20.273Z] +------------------------+------+--------+--------+
[2024-04-16T11:02:20.273Z] 
[2024-04-16T11:02:20.273Z] +---------+------+--------+--------+
[2024-04-16T11:02:20.273Z] |         | Line | Branch | Method |
[2024-04-16T11:02:20.273Z] +---------+------+--------+--------+
[2024-04-16T11:02:20.273Z] | Total   | 0%   | 0%     | 0%     |
[2024-04-16T11:02:20.273Z] +---------+------+--------+--------+
[2024-04-16T11:02:20.273Z] | Average | 0%   | 0%     | 0%     |
[2024-04-16T11:02:20.273Z] +---------+------+--------+--------+
[2024-04-16T11:02:20.273Z]

Hi,

Thanks for the log. Here’s what I notice:

It seems that you execute your tests after you execute analysis? Analysis can’t read the coverage reports if they don’t exist yet. :smiley:

Also, even your log shows 0% coverage, so you probably want to look at that too.

 
HTH,
Ann

No here you can see that the test runs first and then Analysis comes


image

Hi,

Then… why does testing show up in the log after analysis?

Can you provide the full job log starting from the begin command?

 
Thx,
Ann


you can see here in the coverage report xml file i have the coverage of this class but still its not showing

The result that i am getting when run the command using cmd

Hi,

Thanks for the full log. It does indeed show your OpenCover reports being generated before analysis. :sweat_smile:

What I see is that one of your projects has 0% coverage and one has ~53%. Now the analysis log shows that one project is a test project

[2024-04-16T11:02:50.245Z] INFO: Found 2 MSBuild C# projects: 1 MAIN project. 1 TEST project.

I suppose the test project is the one with 0% coverage (right?).

Now, going back to your original post here, coverage on your PR is calculated at 6% of of 205 lines changed in the PR.

When you click on 6.0%, it should take you to the measures view and show you which files were changed in the PR, with the lines to cover and coverage on each file.

Can you check the files in your PR to see what’s showing up as not covered that shouldn’t be?


As a side note, this parameter isn’t supported
/d:sonar.cs.vstest.reportsPaths=/opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/unit/*.trx

And this one is deprecated, per the logs
/d:sonar.cs.opencover.it.reportsPaths=/opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/integration/coverage.opencover.xml

[2024-04-16T11:02:50.551Z] INFO: Sensor [Deprecated] C# Integration Tests Coverage Report Import [csharp]
[2024-04-16T11:02:50.551Z] WARN: Starting with SonarQube 6.2 separation between Unit Tests and Integration Tests Coverage reports is deprecated. Please move all reports specified from *.it.reportPaths into *.reportPaths.
[2024-04-16T11:02:50.551Z] INFO: Parsing the OpenCover report /opt/jenkins/workspace/telco.microservices.gco_PR-319/testResults/integration/coverage.opencover.xml

 
Ann

in the first test i used different branch in which i have lots of file thats why i created a demo class for this to check the root cause .
image
here is what its showing when i run the coverage locally from VS using dotcover the coverage is 100 percent but in sonar its giving me 0 percent.
if there is issue with analysis are generated first then how this is working fine with my other micro-services its calculating fine in other applications with the same code and same pipeline.

Its fixed by fixing by solving this warning :slightly_smiling_face:

Starting with SonarQube 6.2 separation between Unit Tests and Integration Tests Coverage reports is deprecated. Please move all reports specified from *.it.reportPaths into *.reportPaths.

1 Like

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