Skip to content

Commit d3fd164

Browse files
committed
Update Readme
1 parent 42856c5 commit d3fd164

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/AzureDevopsTask/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,32 @@ To learn how to use *ReportGenerator* have a look at the:
3333
```
3434
3535
### Attention
36-
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_.
36+
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_.
3737
To disable the regeneration of the report, you can use the following environment variable in your build:
3838
```yaml
39-
disable.coverage.autogenerate: 'true'
39+
disable.coverage.autogenerate: 'true' # Global environment variable
40+
41+
- task: PublishCodeCoverageResults@1
42+
displayName: 'Publish code coverage results'
43+
inputs:
44+
codeCoverageTool: Cobertura
45+
summaryFileLocation: '$(Build.SourcesDirectory)/coveragereport/Cobertura.xml'
46+
reportDirectory: '$(Build.SourcesDirectory)/coveragereport'
47+
env:
48+
DISABLE_COVERAGE_AUTOGENERATE: 'true' # Local environment variable
49+
```
50+
51+
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/).
52+
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.
53+
The new version has several disadvantages regarding the report in the `Code Coverage` tab within Azure DevOps
54+
- No branch and method coverage
55+
- No details page for each class
56+
57+
**Recommendation**:
58+
Additionally create an artifact containing the full coverage report generated by *ReportGenerator*. You can download the artifact and get full report with all features:
59+
```yaml
60+
- publish: $(Build.SourcesDirectory)/coveragereport
61+
artifact: CoverageReports
4062
```
4163

4264
## Screenshots

0 commit comments

Comments
 (0)