Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
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.
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.
The code coverage summary can be viewed on the Summary tab on the pipeline run summary.
The results can be viewed and downloaded 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.
The code coverage artifacts published during the build can be viewed under the Summary tab on the pipeline run summary.
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.
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.
Note
For .NET and .NET Core, the link to download the artifact is available by choosing the code coverage milestone in the build summary.
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Run quality tests in your build pipeline by using Azure Pipelines - Training
Find out about automated testing that proves your code to be maintainable, understandable, and functioning without repetitive manual testing.
Certification
Microsoft Certified: DevOps Engineer Expert - Certifications
This certification measures your ability to accomplish the following technical tasks: Design and implement processes and communications, design and implement a source control strategy, design and implement build and release pipelines, develop a security and compliance plan, and implement an instrumentation strategy.
Documentation
PublishCodeCoverageResults@1 - Publish code coverage results v1 task
Publish Cobertura or JaCoCo code coverage results from a build.
Code coverage for pull requests - Azure Pipelines
Continuous testing. Measuring code coverage for changes in pull requests.
Review test results - Azure Pipelines
Review continuous test results with a build or release pipeline in Azure Pipelines or Team Foundation Server (TFS)