Home > Back-end >  How can ı publish code covarage result on azure devops project dashboard
How can ı publish code covarage result on azure devops project dashboard

Time:01-03

I apply the new man tests to the code I wrote in the pipeline and I get the code covarage as in the picture. My goal is to show this code covarage percentage in the team dashboard. I couldn't find an extension for it.

ScreenShot

1

I looked under the Azure devops extension but couldn't find any ready extensions.

CodePudding user response:

Hi I suppose that you could refer to this extension enter image description here

Updated on 12/21

You need to configure this widget with a test run pipeline

enter image description here

=========================================================

update 2

I suppose that you need to add your code coverage report to the build summary with enter image description here

My yaml pipeline as below. You will need additional argument to generate code coverage file as format Cobertura.

steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet test'
  inputs:
    command: test
    projects: ''
    arguments: '--collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura'
    publishTestResults: false

- task: PublishCodeCoverageResults@1
  displayName: 'Publish code coverage from **\*\coverage.cobertura.xml'
  inputs:
    codeCoverageTool: Cobertura
    summaryFileLocation: '**\*\coverage.cobertura.xml'
    reportDirectory: '$(System.DefaultWorkingDirectory)\reports'
  • Related