user15716642
user15716642

Reputation: 560

Is it possible to get code coverage in Azure Devops without publishing the artifact?

I am using cobertura as I need it for report files to publish, and it seems to use a different coverage strategy from the default coverage options so I can't compare the coverages from different reports. Because I use cobertura, it produces a report file that I don't want showing up as an artifact when the pipeline runs in my target branch (I do use it for PRs). I just want the percentage posted to the build. How can I get that without the report being published as an artifact?

I have this problem, essentially: Azure Devops Code Coverage falsly recognised as artifact

However, the solution is not applicable to me because when I select my repository and build artifact for a release, it just tells me that "Code Coverage" and "drop" were the last two artifacts to be produced by my build. I can't set a filter or choose one specific folder.

Upvotes: 3

Views: 902

Answers (1)

JukkaK
JukkaK

Reputation: 1175

I think you could use the Azure DevOps logging commands and add the generated file as attachment?

Publish code coverage using .coverage file?

https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash

Upvotes: 1

Related Questions