diff --git a/src/AzureDevopsTask/README.md b/src/AzureDevopsTask/README.md index 985c58b3..f123c431 100644 --- a/src/AzureDevopsTask/README.md +++ b/src/AzureDevopsTask/README.md @@ -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