To ensure a pull request can be merged into the main branch only when test coverage exceeds 90%, what should you configure?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure a branch policy for the main branch..
Why this is the answer
Configuring a branch policy for the main branch is the correct approach because branch policies define requirements that must be met before changes can be merged into a protected branch. In this scenario, you would set up a build validation policy that includes a step to check test coverage, and then configure the policy to require a minimum coverage threshold (e.g., 90%) for successful completion. If the coverage requirement isn't met, the pull request cannot be completed. Configuring a branch policy for feature branches is incorrect because the protection is needed on the target branch (main), not the source (feature). Creating a Publish Test Results task is necessary for reporting coverage, but it doesn't enforce the policy; the branch policy does. Creating a code coverage configuration YAML file defines how coverage is measured, but again, it doesn't enforce the merge requirement.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed