Publish a pipeline Azure Devops code coverage report

0 votes

I am trying to publish a detailed report online in my Azure DevOps Pipeline, but all I got is a link to download this Coverage file. (That can not be read anymore with the community version since the Visual Studio 2019) 

enter image description here

This is my pipeline:

trigger:
  branches:
    include:
    - '*'

pool:
  vmImage: 'windows-2019'

steps:
- task: NuGetToolInstaller@0
  displayName: Instal Nuget
  inputs:
    checkLatest: true

- task: NuGetCommand@2
  displayName: Restore Nuget Packages
  inputs:
    restoreSolution: '**/*.sln'

- task: UseDotNet@2
  displayName: 'Install .NET Core SDK'
  inputs:
    version: 3.1.x
    performMultiLevelLookup: true

- task: DotNetCoreCLI@2
  displayName: Build Tests
  inputs:
    command: 'build'
    projects: '**/OneTienditaUnitTests/*.csproj'
    arguments: '--configuration Release'

- script: dotnet test OneTienditaUnitTests --logger trx --collect "Code coverage"

- task: PublishTestResults@2
  inputs:
    testRunner: VSTest
    testResultsFiles: '**/*.trx'

- task: XamarinAndroid@1
  displayName: Build Android App
  inputs:
    projectFile: '**/*Android*.csproj'
    outputDirectory: '$(build.binariesDirectory)/Release'
    configuration: 'Release'

and if I use Cobertura like this, doesn't work:

- task: DotNetCoreCLI@2
  displayName: Run Tests
  inputs:
    command: 'test'
    projects: '**/OneTienditaUnitTests/*.csproj'
    arguments: '--configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=../reports/coverage/'
    
- task: PublishCodeCoverageResults@1
  displayName: 'Publish code coverage results'
  inputs:
    codeCoverageTool: Cobertura
    summaryFileLocation: '$(build.sourcesdirectory)\reports\coverage\coverage.cobertura.xml'
    reportDirectory: '$(build.sourcesdirectory)\reports\coverage'

Could you please assist me? I am not a DevOps expert.

Dec 20, 2022 in DevOps on Cloud by Damonlang
• 800 points
72 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In DevOps on Cloud

0 votes
0 answers

Azure DevOps Build Pipeline - Exclude a Folder from Code Coverage

I'm trying to exclude a folder from the code coverage analysis, but I'm not having any luck despite a lot of trial and error and research on this site. This is my build pipeline test task: - task: DotNetCoreCLI@2 displayName: 'Running Unit ...READ MORE

Dec 19, 2022 in DevOps on Cloud by Damonlang
• 800 points
310 views
0 votes
1 answer

I am looking for a python code to get my Azure VM status in my email , like whether the running vms port is open to the internet. If its open to internet I should get a mail notification

Hey, @Sourav, Check this out https://www.edureka.co/community/66025/azure-vm-monitoring It deals with ...READ MORE

answered May 29, 2020 in DevOps on Cloud by Sirajul
• 59,210 points
761 views
0 votes
1 answer

How can we publish html test reports in azure devops build results?

This might help you. Have a look ...READ MORE

answered Oct 12, 2020 in DevOps on Cloud by Kriti

edited Oct 27, 2021 by Sarfaraz 5,689 views
0 votes
0 answers
0 votes
0 answers

dotnet build vs publish on Azure DevOps

I have a console app for .NET Core 2.0.  I can successfully create, distribute, and operate this software locally.  In Azure DevOps, I can successfully create and publish this app.  However, I am unable to launch the finished product if I construct the app in Azure DevOps. I tried creating in Azure DevOps using: dotnet build -c ...READ MORE

Dec 13, 2022 in DevOps on Cloud by Nicholas
• 7,760 points
130 views
–1 vote
0 answers
0 votes
1 answer

Azure DevOps - Github status checks

To use the GitHub Status check, first ...READ MORE

answered Mar 25, 2022 in Azure by Edureka
• 12,880 points
355 views
0 votes
1 answer
0 votes
0 answers

OWASP Zed Attack Proxy Scan in DevOps pipeline

I want to do the "Authenticated Scan" ...READ MORE

Mar 15, 2022 in DevOps Tools by Kichu
• 19,050 points
351 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP