Azure CI pipeline how to configure code coverage . Currently it was zero percentage on the code coverage

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Community EditionVersion 8.6 (build 39681)
  • what are you trying to achieve
    Trying to achieve code coverage
  • what have you tried so far to achieve this
    we don’t know how to configure code coverage in the azure pipeline . I have tried to reachout Microsoft Devops team they said due to opensource not giving support . I have to contact you in the community portal to get help , that’s the reason i am here pls help us

Hi Team,

We are using Azure CI pipeline and we have already configured sonarqube scanner which is working fine .

How to configure code coverage in the azure CI pipeline. Currently it was zero percentage on the code coverage

Hi @sudharsanhcl ,

Welcome to SonarSource community! :sonarsource:

Please take a look at our community guides for assistance:

Here is an example pipeline for you compare against that I wrote, this uses VStest and VScoveragexml: https://dev.azure.com/joetingsanchali/_git/sonar-scanning-someconsoleapp?path=%2Fazure-pipelines.yml

If you still have trouble, please show your debug-level logs (adding “sonar.verbose=true” in the extraProperties key of the SonarQubePrepare task) and your azure pipeline.yml.

Thanks for your response joe .

We are using ubuntu 16.04 docker image and linux agent in the azure pipeline .

If you can give example pipeline according to my setup it would helpful for us .

Challenge is : Linux agent not working in the code coverage . But windows agent works

Hi @sudharsanhcl ,

Using linux agent instead of windows agent shouldn’t matter too much. It sounds like the path or slash characters may be causing issues.

Can you share your debug-level logs for the Windows agent and one for Linux agent? Please also show your Azure pipeline.yml.

Joe