DOP-C02 exam dumps

DOP-C02 practice question 22 of 411

AWS Certified DevOps Engineer - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

DOP-C02 Question 22

Select 3

Your team is implementing a CI/CD pipeline for a web application hosted on Amazon ECS. The team wants to ensure that unit tests, integration tests, and UI tests are automatically executed during the pipeline. The pipeline must fail if any of these tests fail. Which of the following steps should you take to meet the requirements?

  1. A

    Configure a testing stage in the pipeline using AWS CodePipeline and integrate it with AWS CodeBuild to run the tests.

  2. B

    Use Amazon CloudWatch Events to detect failed tests and notify the development team after the pipeline completes.

  3. C

    Define separate actions in the pipeline for running unit tests, integration tests, and UI tests, and configure each action to stop the pipeline on failure.

  4. D

    Create a Lambda function to execute the tests and invoke it as part of a CodePipeline action.

  5. E

    Use CodeBuild reports to visualize test results and automatically fail the pipeline if test thresholds are not met.

Show answer and explanation

Correct answers: A, C, E

Explanation

To integrate automated testing into a CI/CD pipeline, AWS CodePipeline can be used alongside AWS CodeBuild to define testing stages. Separate actions should be created for different types of tests (e.g., unit, integration, UI) to ensure proper sequencing and failure handling. CodeBuild reports allow visualization of test results and can enforce pipeline failure on unmet thresholds. Together, these steps ensure the pipeline meets the requirement of running automated tests and failing on test failures.

  • A. Correct.

    Correct: AWS CodePipeline can integrate with AWS CodeBuild to run automated tests as part of the pipeline. CodeBuild is a fully managed build service that can execute unit tests, integration tests, and other types of tests.

  • B. Incorrect.

    Incorrect: While Amazon CloudWatch Events can notify the team about failures, it does not integrate directly into the CI/CD pipeline to fail the pipeline upon test failures. This step alone does not meet the requirements.

  • C. Correct.

    Correct: Defining separate actions for different types of tests ensures that all test stages are executed in sequence and allows the pipeline to fail if any test stage fails.

  • D. Incorrect.

    Incorrect: While Lambda could technically execute the tests, it is not the ideal service for running structured test workflows in a CI/CD pipeline. AWS CodeBuild is better suited for this purpose.

  • E. Correct.

    Correct: CodeBuild reports provide detailed visibility into test results and can be configured to fail the pipeline automatically if tests do not meet the specified success criteria.

Timed practice exam

Take a DOP-C02 practice test under exam conditions

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

Start timed exam