Skip to content

Latest commit

 

History

History
96 lines (60 loc) · 4.09 KB

review-code-coverage-results.md

File metadata and controls

96 lines (60 loc) · 4.09 KB
title description ms.assetid ms.topic ms.custom ms.author author ms.date monikerRange
Review code coverage
Review code coverage results in Azure Pipelines or Team Foundation Server (TFS)
86D94FB7-D730-4ECE-8300-5E76934090A5
conceptual
continuous-test, cross-service
rbatra
raviLiftr
06/23/2020
<= azure-devops

Review code coverage results

[!INCLUDE version-lt-eq-azure-devops]

Code coverage helps you determine the proportion of your project's code that is actually being tested by tests such as unit tests. To increase your confidence of the code changes, and guard effectively against bugs, your tests should exercise - or cover - a large proportion of your code.

Reviewing the code coverage result helps to identify code path(s) that are not covered by the tests. This information is important to improve the test collateral over time by reducing the test debt.

Example

To view an example of publishing code coverage results for your choice of language, see the Ecosystems section of the Pipelines topics. For example, collect and publish code coverage for JavaScript using Istanbul.

View results

:::moniker range=">= azure-devops-2019"

The code coverage summary can be viewed on the Summary tab on the pipeline run summary.

View code coverage results

The results can be viewed and downloaded on the Code coverage tab.

View and download results on the Code coverage tab.

Note

In a multi-stage YAML pipeline, the code coverage results are only available after the completion of the entire pipeline. This means that you may have to separate the build stage into a pipeline of its own if you want to review the code coverage results prior to deploying to production.

Note

Merging code coverage results from multiple test runs is limited to .NET and .NET Core at present. This will be supported for other formats in a future release.

:::moniker-end

Artifacts

:::moniker range=">= azure-devops-2019"

The code coverage artifacts published during the build can be viewed under the Summary tab on the pipeline run summary.

View code coverage artifact

:::moniker-end

  • If you use the Visual Studio Test task to collect coverage for .NET and .NET Core apps, the artifact contains .coverage files that can be downloaded and used for further analysis in Visual Studio.

    View .coverage reports

  • If you publish code coverage using Cobertura or JaCoCo coverage formats, the code coverage artifact contains an HTML file that can be viewed offline for further analysis.

    View html reports

Note

For .NET and .NET Core, the link to download the artifact is available by choosing the code coverage milestone in the build summary.

Tasks

[!INCLUDE help-and-support-footer]