Your team runs CI/CD pipelines in AWS CodePipeline. You need to add unit tests that run as part of the pipeline before artifacts are staged for testing. How should you integrate unit tests into the CI/CD pipelines?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a phase to run unit tests in the AWS CodeBuild buildspec used by the pipeline..
Why this is the answer
Integrating unit tests into the AWS CodeBuild buildspec is the most efficient and standard practice for CodePipeline. CodeBuild is designed for compiling code, running tests, and producing build artifacts. By adding a test phase to the buildspec.yml file, you ensure unit tests execute automatically as part of the build process, failing the build early if tests do not pass, thus preventing faulty code from progressing. Creating a separate CodePipeline for unit tests adds unnecessary complexity and overhead. Using the CodeDeploy agent is for deploying applications, not for running unit tests within a build phase. Creating a testing branch is a version control strategy, not a method for integrating test execution into the CI/CD pipeline itself.
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