-1

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.

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • hi efe, any update? – Ceeno Qi-MSFT Dec 22 '22 at 07:16
  • I understand from my research and reviews that the project should be in the master branch, but the project is now in dev brach and waiting for pull request approval to merge master. I hope we will see the output we hoped when we migrated to the master branch. Thank you very much for your reply, I will inform you. – EFE FEHMİ TAYCI Dec 22 '22 at 07:36

1 Answers1

0

Hi I suppose that you could refer to this extension Code Coverage Widgets

With this widget, I could display the code coverage of my specific pipeline in the dashboards. 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 publish code coverage 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'
Ceeno Qi-MSFT
  • 924
  • 1
  • 3
  • 5
  • Hi thank you for your answer ,I downloaded the extension, I did the pipeline configuration, but I can't see code coverage. Should I have a custom tab called Code Covarage? Do I need to add a build pipeline task – EFE FEHMİ TAYCI Dec 20 '22 at 15:55
  • @EFEFEHMİTAYCI yes, you need to run the pipeline to finish the initial configuration for the widget, like my updated. – Ceeno Qi-MSFT Dec 21 '22 at 01:11
  • I triggered the pipeline after it was finished, but I didn't get any results. What kind of pipeline do you have? Could you please explain? I run authenticate- build -cli and publish tasks to compile .net core – EFE FEHMİ TAYCI Dec 21 '22 at 08:38
  • @EFEFEHMİTAYCI I suppose that you need to add a `publish code coverage` task to post the code coverage report to your build summary. Check my update – Ceeno Qi-MSFT Dec 21 '22 at 09:38