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
• 1,230 points
905 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
• 1,230 points
3,074 views
0 votes
0 answers

Azure devops pipeline variable for a task step name

Is a variable available for the name of an Azure devops pipeline task step, as highlighted below? image from the pipeline I went over the predefined variables at https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=classic  However, ...READ MORE

Jan 5, 2023 in DevOps on Cloud by Damonlang
• 1,230 points
651 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,230 points
1,571 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 8,514 views
0 votes
1 answer
–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
• 13,620 points
855 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
713 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