DVA-C02 Question 258
Select 2You are working on an application that is deployed using AWS CodePipeline. As part of your deployment process, you want to automate testing to ensure that the application passes integration tests before it is deployed to production. Which of the following steps should you take to achieve this in AWS CodePipeline?
- A
Add a CodeBuild action to the pipeline to run the integration tests.
- B
Use AWS CodeDeploy to configure deployment strategies instead of adding tests.
- C
Add a custom script that runs integration tests after the production deployment stage in the pipeline.
- D
Configure a separate testing stage in AWS CodePipeline and use AWS CodeBuild or a third-party tool for test execution.
- E
Use Amazon CloudWatch to monitor the pipeline and trigger manual tests when errors occur.
Show answer and explanation
Correct answers: A, D
Explanation
To automate deployment testing in AWS CodePipeline, you should integrate testing as a part of the pipeline stages. AWS CodeBuild is a powerful tool that can run build and test tasks, making it suitable for executing automated integration tests. Additionally, having a dedicated testing stage in the pipeline ensures that integration tests are run before deploying the application to production, helping to identify issues early and maintain application stability.
- A. Correct.
Correct: AWS CodeBuild can be used to run automated integration tests as part of a pipeline stage. This is a common approach to automate testing during the deployment process.
- B. Incorrect.
Incorrect: AWS CodeDeploy is used to handle deployment strategies like canary or blue/green deployments. It does not handle automated testing directly.
- C. Incorrect.
Incorrect: Running tests after production deployment defeats the purpose of detecting issues early in the pipeline. Automated tests should be configured before the production stage.
- D. Correct.
Correct: Creating a dedicated testing stage in the pipeline and using AWS CodeBuild or third-party tools for test execution is a recommended approach for automated deployment testing.
- E. Incorrect.
Incorrect: Amazon CloudWatch is a monitoring tool and does not provide a mechanism to automate tests. Triggering manual tests is not consistent with the goal of automation.