I have Azure Devops Build pipeline for Xmarin project - which is .NET core project. I have unit test cases defined in that which get executed successfully.
Steps:
- Build project
- Run unit tests
- Run sonar Analysis.
Now - Run sonar Analysis - give error as The Code Coverage report doesn't contain any coverage data for the included files.
But the Azure DevOps displays the Code Coverage tab and display the coverage percentage as well.
- Tried to Covert the .coverage file to .coveragexml file.
- Tried to change the VsTest version from 2 to 1
Tried to add runConfigSetting file in the project which defines the code Coverage tool settings.
Added extra properties in Sonar Init step
steps:
task: SonarQubePrepare@4
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: SonarAPI
projectKey: XXX
projectName: XXX
extraProperties: '/d:sonar.cs.vscoveragexml.reportsPaths="**/*.coveragexml"'`