Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps: ReportGenerator vs PublishCodeCoverageResults #398

Closed
bhuwan-agarwal opened this issue Nov 7, 2020 · 1 comment
Closed

Comments

@bhuwan-agarwal
Copy link

I'm trying to understand the difference between the code coverage reports generated via the PublishCodeCoverageResults vs ReportGenerator Azure pipeline extension tasks. From the initial impressions they look quite the same.

Any details will be helpful?

@danielpalme
Copy link
Owner

danielpalme commented Nov 7, 2020

As long as you want the coverage results of a single Cobertura file and you don't want to use any of the parameters of the ReportGenerator Azure pipeline extension task, you probably won't notice any difference.

If you want to use the latest version of ReportGenerator or if you want to to use specify any parameters, you should use the ReportGenerator Azure pipeline extension task.

The main issue with the PublishCodeCoverageResults task is, that it regenerates the HTML report based on the supplied Cobertura file and ignores the HTML files generated by ReportGenerator.
This may result in unexpected behavior. See:

You can prevent the report regeneration with the following environment variable:

disable.coverage.autogenerate: 'true'

The environment variable is not well documented and the default behavior is not what users may expect.

How to decide

ReportGenerator Azure pipeline extension task PublishCodeCoverageResults
- Latest version of ReportGenerator
- Support for parameters (e.g. filters)
- Support for merging several coverage files
Easy to setup for a single coverage file

@danielpalme danielpalme pinned this issue Nov 7, 2020
@danielpalme danielpalme changed the title Using ReportGenerator vs PublishCodeCoverageResults Azure DevOps: ReportGenerator vs PublishCodeCoverageResults Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants