After the SonarCloud update on January 10th, we have observed that some repositories are incorrectly displaying code coverage as 0%. This issue did not exist before the update, and no changes were made to our CI/CD pipelines or configuration files.
Hi,
Welcome to the community!
What do your analysis logs say?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
This guide will help you find them.
Ann
analysis log.txt (40.7 KB)
Please find the analysis log…
Hi,
It looks like we’re dealing with a .NET project here?
How are you firing analysis, and with what properties? When in the pipeline is your coverage report generated?
Ann
Hi thanks for getting back . I work along with Sreenivasulu in the same team. So below are the details
we use azure devops classic ci/cd pipeline
step 1 : Prepare Analysis Configuration
arguments passed
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml sonar.exclusions=src/Migrations/**,src/MigrationScript/**
step 2: we run the normal dotnet restore , dotnet test steps etc
then we run the Run Code Analysis task - the report gets generated at this task as per the pipeline logs
INFO: Parsing the OpenCover report /agentpath/ coverage.opencover.xml
let me know if you need anything else
Hi,
Thanks for those details.
Going back to the analysis log, I see this:
2025-04-04T02:15:14.5828226Z INFO: Parsing the OpenCover report /agent/_work/_temp/e0d7c1ed-1e77-4623-b02e-4abbc6884c50/coverage.opencover.xml 2025-04-04T02:15:14.6585298Z INFO: Adding this code coverage report to the cache for later reuse: /agent/_work/_temp/e0d7c1ed-1e77-4623-b02e-4abbc6884c50/coverage.opencover.xml 2025-04-04T02:15:14.6684670Z INFO: Coverage Report Statistics: 520 files, 0 main files, 0 main files with coverage, 520 test files, 0 project excluded files, 0 other language files. 2025-04-04T02:15:14.6687327Z WARN: The Code Coverage report doesn't contain any coverage data for the included files. Troubleshooting guide: https://community.sonarsource.com/t/37151
You should check the troubleshooting guide.
HTH,
Ann
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.