Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpalme committed Apr 6, 2024
1 parent 42856c5 commit d3fd164
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/AzureDevopsTask/README.md
Expand Up @@ -33,10 +33,32 @@ To learn how to use *ReportGenerator* have a look at the:
```

### Attention
The [Publish Code Coverage Results](https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/PublishCodeCoverageResultsV1) task from Microsoft regenerates the report with different settings and based on the supplied _Coberatura_ file (see [announcement](https://docs.microsoft.com/en-us/azure/devops/release-notes/2019/sprint-150-update#cobertura-code-coverage-report-updates)). Moreover it does not necessarily use the latest version of _ReportGenerator_.
The [PublishCodeCoverageResultsV1](https://learn.microsoft.com/de-de/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v1?view=azure-pipelines) task from Microsoft regenerates the report with different settings and based on the supplied _Coberatura_ file (see [announcement](https://docs.microsoft.com/en-us/azure/devops/release-notes/2019/sprint-150-update#cobertura-code-coverage-report-updates)). Moreover it does not necessarily use the latest version of _ReportGenerator_.
To disable the regeneration of the report, you can use the following environment variable in your build:
```yaml
disable.coverage.autogenerate: 'true'
disable.coverage.autogenerate: 'true' # Global environment variable

- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coveragereport/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/coveragereport'
env:
DISABLE_COVERAGE_AUTOGENERATE: 'true' # Local environment variable
```

The [PublishCodeCoverageResultsV1](https://learn.microsoft.com/de-de/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v1?view=azure-pipelines) will get [deprecated](https://devblogs.microsoft.com/devops/new-pccr-task/).
Microsoft recommends to use the [PublishCodeCoverageResults@2](https://learn.microsoft.com/de-de/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2?view=azure-pipelines) instead.
The new version has several disadvantages regarding the report in the `Code Coverage` tab within Azure DevOps
- No branch and method coverage
- No details page for each class

**Recommendation**:
Additionally create an artifact containing the full coverage report generated by *ReportGenerator*. You can download the artifact and get full report with all features:
```yaml
- publish: $(Build.SourcesDirectory)/coveragereport
artifact: CoverageReports
```

## Screenshots
Expand Down

0 comments on commit d3fd164

Please sign in to comment.