AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 357
A company has application code in an AWS CodeConnections compatible Git repository. The company wants to configure unit tests to run when pull requests are opened. The company wants to ensure that the test status is visible in pull requests when the tests are completed. The company wants to save output data files that the tests generate to an Amazon S3 bucket after the tests are finished.
Which combination of solutions will meet these requirements? (Choose three.)
Answer options
- A. Create an IAM service role to allow access to the resources that are required to run the tests. B Create a pipeline in AWS CodePipeline that has a test stage. Create a trigger to run the pipeline when pull requests are created or updated. Add a source action to report test results.
- C. Create an AWS CodeBuild project to run the tests. Enable webhook triggers to run the tests when pull requests are created or updated. Enable build status reporting to report test results.
- D. Create a buildspec.yml file that has a reports section to upload output files when the tests have finished running.
- E. Create a buildspec.yml file that has an artifacts section to upload artifacts when the tests have finished running.
- F. Create an appspec.yml file that has a files section to upload output files when the tests have finished running.
Correct answer: A, C, E
Explanation
To run unit tests and report the status back to the pull request, AWS CodeBuild can be configured with webhook triggers and build status reporting enabled (Option C). An IAM service role is required to grant CodeBuild the permissions to run the tests and write to S3 (Option A). Finally, the artifacts section of the buildspec.yml file is used to specify which generated files should be uploaded to the S3 bucket configured in the CodeBuild project (Option E).