A team has Python Lambda functions stored in CodeCommit and has added unit tests. They need to run these unit tests inside an existing CodePipeline and produce test reports that the company can view. Which solution satisfies this?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a new CodeBuild project and add a test stage in CodePipeline that uses it. Create a CodeBuild report group. Add a buildspec.yml that runs the unit tests and outputs JUNITXML during the build phase, and configure the test reports to be uploaded to the CodeBuild report group..
Why this is the answer
The correct solution leverages AWS CodeBuild's native test reporting capabilities. By creating a new CodeBuild project and a CodeBuild report group, the team can integrate unit test execution directly into their CodePipeline. The buildspec.yml file is crucial here; it defines the commands to run the Python unit tests and specifies that the output should be in JUNITXML format, which CodeBuild can parse. Configuring the test reports section in the buildspec.yml ensures these results are uploaded to the designated CodeBuild report group, making them viewable within CodeBuild. Incorrect options: CodeGuru Reviewer is for static code analysis and identifying potential defects, not for running unit tests or generating test reports from test execution. CodeArtifact is a repository for software packages, not for storing test reports. appspec.yml is used for CodeDeploy, not CodeBuild. CUCUMBERJSON is for behavior-driven development tests, not general unit tests. While an S3 bucket could store reports, CodeBuild's integrated report groups offer a more streamlined and viewable solution for test results within the AWS console, rather than raw HTML files in S3.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed