0
votes

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"'`
1

1 Answers

1
votes

It solved for me when I add in .csproject file.

Add following code snippet in existing <PropertyGroup> section.

<DebugType>Full</DebugType>