Azure Devops - No Coverage - C# .net

I am just setting up my first project within sonar cloud, however I cannot seem to get any code coverage within Azure DevOps - my Build Gate project is set up minimally as follows


However when I have submitted a PR to SonarCloud everything else is displayed except code coverage

Yet there is code coverage within the pipeline as it publishes the results.

Hey there.

What do the logs say about the import of coverage data?

INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report D:\a\_temp\0e4e0c06-8a53-44e7-9db5-256fc457960c\VssAdministrator_fv-az171-654_2023-04-30.15_19_21.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\_temp\0e4e0c06-8a53-44e7-9db5-256fc457960c\VssAdministrator_fv-az171-654_2023-04-30.15_19_21.coveragexml
INFO: Parsing the Visual Studio coverage XML report D:\a\_temp\0f510922-754b-4b43-989d-7cfd313aa275\VssAdministrator_fv-az171-654_2023-04-30.15_19_25.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\_temp\0f510922-754b-4b43-989d-7cfd313aa275\VssAdministrator_fv-az171-654_2023-04-30.15_19_25.coveragexml
INFO: Parsing the Visual Studio coverage XML report D:\a\_temp\f1e8bb6b-514c-44f1-865e-ec298bf0d3d5\VssAdministrator_fv-az171-654_2023-04-30.15_19_12.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\_temp\f1e8bb6b-514c-44f1-865e-ec298bf0d3d5\VssAdministrator_fv-az171-654_2023-04-30.15_19_12.coveragexml
INFO: Parsing the Visual Studio coverage XML report D:\a\_temp\f75fb825-e84f-4913-a6a8-798a7b61e4d9\VssAdministrator_fv-az171-654_2023-04-30.15_19_34.coveragexml
INFO: Adding this code coverage report to the cache for later reuse: D:\a\_temp\f75fb825-e84f-4913-a6a8-798a7b61e4d9\VssAdministrator_fv-az171-654_2023-04-30.15_19_34.coveragexml
INFO: Coverage Report Statistics: 105 files, 0 main files, 0 main files with coverage, 105 test files, 0 project excluded files, 0 other language files.
WARN: The Code Coverage report doesn't contain any coverage data for the included files. Troubleshooting guide: https://community.sonarsource.com/t/37151
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=234ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 297 source files to be analyzed
INFO: Blaming files using native implementation
INFO: 259/297 source files have been analyzed
INFO: Blaming files using native implementation (done) | time=10567ms
INFO: SCM Publisher 297/297 source files have been analyzed (done) | time=11115ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 1097ms, dir size=903 KB
INFO: Analysis report compressed in 360ms, zip size=466 KB
INFO: Analysis report uploaded in 1109ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=macrosuk_Mukesh
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=AYfSwKx1wDSgSwkTnpRX
INFO: Sensor cache published successfully
INFO: Analysis total time: 38.351 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:12.030s
INFO: Final Memory: 41M/140M
INFO: ----------------------`Preformatted text`--------------------------------------------------
The SonarScanner CLI has finished
15:20:57.243  Post-processing succeeded.
Finishing: Run Code Analysis

Thanks.

It looks like all the files your code coverage tool produced coverage for are identified as test files.

Is your source code being properly indexed as product code?

Hi Colin - Apologies for the late reply.

This seems to have been my entire problem and seems to have sorted my issue.

Thank you very much

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