Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gladjohn opened this issue Sep 20, 2024 · 0 comments
Open

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

gladjohn opened this issue Sep 20, 2024 · 0 comments

Comments

@gladjohn
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Committed
Development

No branches or pull requests

1 participant