AZ-400 · Question #570
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might h
The correct answer is B. No. Option B (No) is correct because the question references a YAML snippet that we must assume is incomplete or incorrectly configured - most likely it uses a condition that prevents tests from running when the pipeline is cancelled, but does not guarantee tests run on every pipelin
Question
Exhibits
Options
- AYes
- BNo
How the community answered
(61 responses)- A33% (20)
- B67% (41)
Explanation
Option B (No) is correct because the question references a YAML snippet that we must assume is incomplete or incorrectly configured - most likely it uses a condition that prevents tests from running when the pipeline is cancelled, but does not guarantee tests run on every pipeline execution unless cancelled. A common mistake is using condition: always() without also ensuring the pipeline fails when tests fail (e.g., missing failTaskOnFailedTests: true in the PublishTestResults task, or not properly configuring the test task to propagate failures).
Why the distractor (A - Yes) is wrong: The proposed YAML solution likely omits a critical element - such as failTaskOnFailedTests: true on the PublishTestResults task, or uses an incorrect condition like succeededOrFailed() instead of a combination that both publishes results and ensures pipeline failure on test failures. Without all three requirements being met simultaneously, the solution is incomplete.
Memory Tip: Remember the three-part checklist for pipeline test requirements: (1) Fail on test failure (failTaskOnFailedTests: true), (2) Publish results (PublishTestResults task), and (3) Always run unless cancelled (condition: succeededOrFailed() - NOT always(), since always() runs even when cancelled). If any one of these is missing or misconfigured, the answer is No.
Topics
Community Discussion
No community discussion yet for this question.

