AZ-400 exam dumps

AZ-400 practice question 109 of 306

Designing and Implementing Microsoft DevOps Solutions. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AZ-400 Question 109

Single answer

Your team maintains an Azure DevOps pipeline to build, test, and deploy a microservices-based application. Currently, the pipeline runs unit tests and then immediately proceeds to a release step. You want to incorporate an additional set of longer-running integration tests such that they only execute if the unit tests pass, and the pipeline should fail quickly if these integration tests do not succeed. Which strategy best meets these requirements while maintaining an efficient pipeline workflow?

  1. A

    Place all tests (unit and integration) in one job, ensuring the pipeline completes as a single process.

  2. B

    Create a separate pipeline for integration tests that triggers manually after the main pipeline completes.

  3. C

    Add a separate stage for integration tests in the same pipeline and configure it to run only after unit tests succeed. Fail the pipeline if integration tests fail.

  4. D

    Run integration tests before unit tests to confirm endpoint availability early in the build process.

Show answer and explanation

Correct answer: C

Explanation

A best practice in designing a testing strategy for CI/CD pipelines is to organize tests into stages based on complexity and runtime. Run fast, isolated tests (such as unit tests) early to catch basic errors quickly (fail fast), and only proceed with more time-consuming tests (like integration tests) if those early checks pass. This approach adheres to the commonly recommended testing pyramid guidance (Microsoft Docs: https://learn.microsoft.com/azure/devops/pipelines/test) and ensures your pipeline provides rapid feedback while still validating application integrity at multiple levels.

  • A. Incorrect.

    Option 1 is incorrect because combining both unit and integration tests in one job increases the total build time and doesn�t allow you to fail fast for integration tests exclusively. Unit tests help ensure basic code correctness and should be quick; integration tests can be more time-consuming and typically run later.

  • B. Incorrect.

    Option 2 is incorrect because creating a completely separate, manually triggered pipeline means you don�t fail the primary pipeline quickly if integration tests fail. This approach introduces a manual step and delays feedback on integration test results.

  • C. Correct.

    Option 3 is correct because using a separate stage for integration tests in the same pipeline allows you to: (1) run unit tests first to fail fast for basic code errors, (2) only proceed to integration tests if unit tests pass, and (3) fail the overall pipeline immediately if integration tests fail. This maximizes efficiency and provides clear feedback.

  • D. Incorrect.

    Option 4 is incorrect because running integration tests before unit tests defeats the purpose of catching simple errors early. Typically, you run unit tests first as they are faster and pinpoint errors in isolation, ensuring problems are addressed before more complex integration checks.

Timed practice exam

Take a AZ-400 practice test under exam conditions

70 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam