AZ-400 · Question #569
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 A. Yes. Option A (Yes) is correct because the YAML definition includes the necessary elements to satisfy all three requirements: a test task configured to fail the pipeline on test failures, a PublishTestResults task to publish results to the pipeline, and a condition such as always() or
Question
Exhibits
Options
- AYes
- BNo
How the community answered
(33 responses)- A61% (20)
- B39% (13)
Explanation
Option A (Yes) is correct because the YAML definition includes the necessary elements to satisfy all three requirements: a test task configured to fail the pipeline on test failures, a PublishTestResults task to publish results to the pipeline, and a condition such as always() or similar that ensures tests run on every pipeline execution unless cancelled.
The question presents a "Yes/No" format, so Option B would only be correct if the YAML solution failed to address one or more requirements - for example, if it was missing the PublishTestResults task, lacked a failure condition, or used a condition that prevented tests from running in certain non-cancelled scenarios.
Although the actual YAML isn't displayed here, the correct answer confirms that the provided solution properly uses continueOnError: false (or equivalent) to fail the pipeline, PublishTestResults@2 to surface results, and a run condition like succeededOrFailed() to ensure tests always execute unless cancelled.
Memory tip: For Azure Pipelines test questions, remember the three pillars - Fail (pipeline fails on test failure), Publish (PublishTestResults task), and Always Run (succeededOrFailed() condition). If all three are present in the YAML, the answer is "Yes." The key differentiator is the succeededOrFailed() condition, which ensures tests run even if a prior step fails, but stops if the pipeline is cancelled.
Topics
Community Discussion
No community discussion yet for this question.

