Issue
We’re doing an Incremental PR analysis using SonarCloud in Azure DevOps pipeline but the code coverage and duplications results are not pushed anymore. The rest of the metrics are coming through normally.
In the SonarCloud portal we’re either seeing 0% coverage or a message telling us to set up code coverage.
We have validated that no relevant changes have been made to the code, pipeline, infrastructure or SonarCloud settings.
We are using the default Azure Devops SonarCloud task for all three steps with the default settings besides three file exclusion rules. Removing these rules entirely didn’t seem to fix the issue.
We are seeing coverage in the associated DevOps pipeline:
Any help on this would be greatly appreciated.
Yaml pipeline steps
Below are the used pipeline steps.
Prepare sonarcloud
parameters:
- name: projectKey
type: string
### Prepare SonarCloud
steps:
- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: SonarCloud
organization: ##Redacted##
projectKey: ${{ parameters.projectKey }}
Run SonarCloud Analysis
# Run SonarCloud Analysis
steps:
- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
displayName: 'Run SonarCloud Analysis'
Publish SonarCloud results
# Publish Quality Gate Result
steps:
- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
Logs
Prepare SonarCloud logs:
SonarScanner for MSBuild 5.13
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
08:37:50.931 Updating build integration targets...
08:37:51.102 Fetching analysis configuration settings...
08:37:51.743 Provisioning analyzer assemblies for cs...
08:37:51.743 Installing required Roslyn analyzers...
08:37:51.743 Processing plugin: csharp version 9.3.0.71466
08:37:52.025 Processing plugin: vbnet version 9.3.0.71466
08:37:52.087 Processing plugin: securitycsharpfrontend version 10.1.0.21056
08:37:52.4 Provisioning analyzer assemblies for vbnet...
08:37:52.4 Installing required Roslyn analyzers...
08:37:52.4 Processing plugin: csharp version 9.3.0.71466
08:37:52.4 Processing plugin: vbnet version 9.3.0.71466
08:37:52.4 Incremental PR analysis: Base branch parameter was not provided.
08:37:52.415 Cache data is empty. A full analysis will be performed.
08:37:52.431 Pre-processing succeeded.
Finishing: Prepare analysis on SonarCloud
Run SonarCloud Analysis logs:
SonarCloudLogs.txt (126.9 KB)
Publish SonarCloud results logs
Starting: Publish Quality Gate Result
==============================================================================
Task : Publish Quality Gate Result
Description : Publish SonarCloud's Quality Gate result on the Azure Pipelines build result. To be used after the actual analysis.
Version : 1.12.0
Author : sonarsource
Help : Version: 1.12.0. [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
Finishing: Publish Quality Gate Result