Azure DevOps Integration

Must-share information (formatted with Markdown):

  • I am integrating SonarQube in Azure DevOps pipeline (https://dev.azure.com)
  • I have integrated successfully and able to see values for Bugs, Vulnerabilities, Code Smells, etc but unable to see value for Coverage (Coverage shows as 0.0%)
  • I have below code in my yml file (Note: develop is my default branch, and I use free/community version)
  • task: SonarQubePrepare@4
    inputs:
    SonarQube: “${{ parameters.SCSonarQube}}”
    scannerMode: “MSBuild”
    projectKey: “$(System.TeamProject)-$(Build.DefinitionName)”
    condition: eq(variables[‘build.sourceBranch’], ‘refs/heads/develop’)

  • task: SonarQubeAnalyze@4
    displayName: “Run Code Analysis”
    condition: and(succeeded(), eq(variables[‘build.sourceBranch’], ‘refs/heads/develop’))

    • task: SonarQubePublish@4
      inputs:
      pollingTimeOutSec: “300”
      condition: and(succeeded(), eq(variables[‘build.sourceBranch’], ‘refs/heads/develop’))

Howdy Ashish,

Welcome to the community!

You didn’t mention which coverage frameworks you are using, but go ahead and take a look available supported ones here:
https://docs.sonarqube.org/latest/analysis/coverage/

These report paths should be included in your SonarQubePrepare@4 task. Try that out and let me know if it fixes the issue.

thanks,
Aaron