

The settings that can be changed are: Setting Set the desired values in this file and it will be used automatically the next time the pipeline runs. If you would like to change the default settings of the code coverage experience for pull requests, you must include a configuration YAML file named azurepipelines-coverage.yml at the root of your repo. While you can build code from a wide variety of version control systems that Azure Pipelines supports, the code coverage for pull requests feature discussed in this document is currently available only for Azure Repos. For example, collect and publish code coverage for. To learn more about collecting and publishing code coverage results for the language of your choice, see the Ecosystems section. Coverage results must then be published to the server for reporting.

In this pipeline, configure the test tool you are using to collect code coverage metrics. In order to get coverage metrics for a pull request, first configure a pipeline that validates pull requests. However, in the context of pull requests, developers are focused on the changes they are making and want to know whether the specific lines of code they have added or changed are covered. Typically, coverage gets measured for the entire codebase of a project. Repo owners may also want to set policies to prevent merging large untested changes. This means that when developers raise pull requests, knowing whether their changes are covered by tests would help plug any testing holes before the changes are merged into the target branch. To ensure that quality for your project improves over time (or at the least, does not regress), it is essential that new code being brought into the system is well tested. Code coverage is an important quality metric and helps you measure the percentage of your project's code that is being tested.
