microsoft-authentication-library-for-dotnet icon indicating copy to clipboard operation
microsoft-authentication-library-for-dotnet copied to clipboard

[Engineering task] Protect a branch using a code coverage policy

Open gladjohn opened this issue 5 months ago • 0 comments

Task type

Engineering excellence

Description

Visibility of code coverage in pull requests help developers and reviewers ensure that new code is tested. When differential code coverage is enabled for pull requests, reviewers can see which branches lack unit test coverage. This also helps prevent the introduction of untested code in a legacy repository, effectively stopping the “bleeding.” Note that, it doesn’t guarantee that the tests covering the code are effective, only that the code is covered by some test.

Guidance : https://eng.ms/docs/microsoft-security/identity/identity-productivity/quality/test/unittest/enablecodecoverageinprs

Code coverage status check for pull requests is only a suggestion for developers and it doesn't prevent pull requests with low code coverage from being merged into the target branch. To prevent developers from merging changes that don't meet a coverage threshold, you must configure a branch policy using the coverage status check.

Solution

more info here : https://learn.microsoft.com/en-us/azure/devops/pipelines/test/codecoverage-for-pullrequests?view=azure-devops#protect-a-branch-using-a-code-coverage-policy

gladjohn avatar Sep 20 '24 19:09 gladjohn