Versions used:
SonarQube Server: Enterprise Edition v2025.1.3
Scanner: Azure DevOps SonarQube tasks (v6 / v8.x)
Build: Classic Azure DevOps (TFS) pipeline
Language: C# (.NET Framework)
Deployment type:
Central SonarQube server (enterprise/internal hosted, not Docker/Helm from my side)
What I’m trying to achieve:
Get unit test results and code coverage properly reflected in SonarQube dashboard
Ensure both old and new code coverage is visible and accurate
What I have configured:
sonar.cs.vstest.reportsPaths=$(Agent.BuildDirectory)/TestResults/**/\*.trx
sonar.cs.vscoveragexml.reportsPaths=$(Agent.BuildDirectory)/TestResults/Combined/**/\*.coveragexml
What I’ve tried so far:
Ensured .trx files are generated and available in TestResults
Combined coverage files into a Combined folder
Verified .coveragexml files exist in build output
Updated SonarQube tasks (moved from older version to v6+)
Checked pipeline execution time (unit tests now running faster than before)
Confirmed pipeline logs show: ANALYSIS SUCCESSFUL
Issue:
Code coverage is not displayed in SonarQube (both new and overall code)
Some test projects show 0% coverage or empty results. This issue is happening after migrating from onprem sonarqube to cloud sonarqube