Integrate SonarQube with your AI agent, scan for secrets and dependency risks, and explore and manage issues—all from the command line.
Start using SonarQube CLI
Windows Presentation Foundation (WPF) c# code not showing code coverage % in SQ dashboard though unit tests are success in Azure Devops pipelines. Here I have attached files (Run Code Analysis & Publish Quality Gate Result). Please suggest us to get code coverage % in Sonarqube dashboard for successful unit tests. 11_VsTest - testAssemblies.txt (350.0 KB) Uploading: 12_Run Code Analysis.txt…
I have given below Prepare Analysis Configuration
sonar.inclusions=/*.cs,
sonar.inclusions=/**/*.cs,
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\TestResults*.trx,
sonar.verbose=true
Now I’m able to find .trx file like below.
"Code coverage command line tool: I:\VS2019\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe
Fetching code coverage report information from TFS…
Attempting to locate a test results (.trx) file…
Looking for TRX files in: F:\tfs_work\6110\TestResults, F:\tfs_work\6110\s\TestResults
The following test results files were found: F:\tfs_work\6110\s\TestResults\TFSBuild_LOUSSPWTP1135_2021-12-07_06_40_02.trx
Absolute path to coverage file:
F:\tfs_work\6110\s\TestResults\TFSBuild_LOUSSPWTP1135_2021-12-07_06_40_02\In\LOUSSPWTP1135\TFSBuild_LOUSSPWTP1135_2021-12-07.06_39_50.coverage
The following code coverage attachments were found from the trx files: F:\tfs_work\6110\s\TestResults\TFSBuild_LOUSSPWTP1135_2021-12-07_06_40_02\In\LOUSSPWTP1135\TFSBuild_LOUSSPWTP1135_2021-12-07.06_39_50.coverage"
But still getting same like earlier as
“Adding this code coverage report to the cache for later reuse: F:\tfs_work\6110.\s\TestResults\TFSBuild_LOUSSPWTP1135_2021-12-07_06_40_02\In\LOUSSPWTP1135\TFSBuild_LOUSSPWTP1135_2021-12-07.06_39_50.coveragexml
Analyzing coverage after aggregate found ‘0’ coverage files.
The total number of file count statistics is ‘0’.”
I understood as, statistics count shouldn’t be ‘0’. Need to find way to get the some values.