# Azure Devops task no coverage values pushed SonarCloud

**URL:** <https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250>\
**Category:** SonarQube Cloud\
**Tags:** dotnet, sonarqube-cloud\
**Created:** [May 14, 2021, 8:31am UTC](https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250 "2021-05-14T08:31:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haithem](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Haithem](https://community.sonarsource.com/u/Haithem)\
**Post date:** [May 14, 2021, 8:31am UTC](https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250/1 "2021-05-14T08:31:17Z")

</div>

- ALM used : Azure DevOps
- CI system used : Azure DevOps
- Scanner command used when applicable (private details masked)

Task from pipe :

- task: SonarCloudPrepare@1  
displayName: ‘Sonar -Code Analysis - Begin (PR)’  
condition: eq(variables[‘Build.Reason’], ‘PullRequest’)  
inputs:  
SonarCloud: $(sonar.cloud)  
organization: $(sonar.organization)  
scannerMode: ‘MSBuild’  
projectKey: $(sonar.projectKey)  
projectName: $(sonar.projectName)  
projectVersion: $(sonar.projectVersion)  
extraProperties: |  
sonar.cs.opencover.reportsPaths=${{parameters.workingDirectory}}\reports\*.coverage.openCover.xml  
sonar.analysis.buildNumber=$(Build.BuildId)  
sonar.analysis.pipeline=$(Build.BuildId)  
sonar.analysis.sha1=$(System.PullRequest.SourceCommitId)  
sonar.analysis.prNumber=$(System.PullRequest.PullRequestNumber)  
sonar.analysis.repository=$(Build.Repository.ID)  
sonar.exclusions = \*\*/\*.sql

- Languages of the repository : C#
- Error observed :  
Some coverage are converted other are skipped, but no coverage in Sonar :  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/8/f/8fa1d1e2c6c45d55901e8b91e4e6bd6028fc970b.png)

Debug from auree devops SonarCloudAnalyze@1 task :  
22:19:57.041 INFO: Parsing the OpenCover report D:\a\1\s\Src\_**.coverage.openCover.xml  
22:19:57.042 DEBUG: CoveredFile created: (ID ‘1’, path ' **.cs’, indexed as ‘_**.cs’).  
.  
.  
.  
22:19:57.114 DEBUG: Skipping ‘\_\_\_\_.cs’ as it is a test file.  
22:19:57.114 DEBUG: Skipping '**_.cs’ as it is a test file.  
.  
.

22:19:57.114 DEBUG: The total number of file count statistics is ‘182’.  
**22:19:57.115 INFO: Coverage Report Statistics: 182 files, 0 main files, 0 main files with coverage, 182 test files, 0 project excluded files, 0 other language files**.

22:19:57.115 WARN: The Code Coverage report doesn’t contain any coverage data for the included files. Troubleshooting guide: [[Coverage] Troubleshooting guide for .NET code coverage import](https://community.sonarsource.com/t/37151)

But from other hand i have this report with Azure devops PR reports (generated with Cobertura):

\*.coverage.openCover.xml are pushed Azure devops and give this report :

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/7/1/71b412a6d5b45fd06a6ae45e81da0ccaf929dfa3.png)

- Steps to reproduce

---

<div class="post-metadata">

**Author:** ![Pavel\_Mikula](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pavel_mikula/32/7381_2.png) [@Pavel\_Mikula](https://community.sonarsource.com/u/Pavel_Mikula)\
**Post date:** [May 18, 2021, 2:20pm UTC](https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250/8 "2021-05-18T14:20:02Z")

</div>

Hi @Haithem,

Welcome to our community forum. This line from your logs suggests that your project is classified as a test project and coverage is not imported for test projects.

> [@Haithem](#):
>
> 22:19:57.115 INFO: Coverage Report Statistics: 182 files, 0 main files, 0 main files with coverage, **182 test files** , 0 project excluded files, 0 other language files

Please make sure that your production code project is not classified as test project, for example by marking it as `<SonarQubeTestProject>False</SonarQubeTestProject>`. You can find more information about test project detection here:

> **[Analysis of product projects vs. test projects](https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects)**
>
> SonarScanner for .NET. Contribute to SonarSource/sonar-scanner-msbuild development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Haithem](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Haithem](https://community.sonarsource.com/u/Haithem)\
**Post date:** [May 19, 2021, 9:15am UTC](https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250/9 "2021-05-19T09:15:16Z")

</div>

Hello @Pavel_Mikula  
Thank you for your reactivity, i have resolved the problem by improving the quality of my original report sended to Sonar, OpenCover was only generating coverage on tests files.

Thank you.  
Haithem

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [May 26, 2021, 9:15am UTC](https://community.sonarsource.com/t/azure-devops-task-no-coverage-values-pushed-sonarcloud/43250/10 "2021-05-26T09:15:22Z")

</div>

Closed on May 26, 2021, 9:15am UTC

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