exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 186 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 186
Topic #: 1
[All AWS Certified Developer Associate Questions]

A team of developers is using an AWS CodePipeline pipeline as a continuous integration and continuous delivery (CI/CD) mechanism for a web application. A developer has written unit tests to programmatically test the functionality of the application code. The unit tests produce a test report that shows the results of each individual check. The developer now wants to run these tests automatically during the CI/CD process.

Which solution will meet this requirement with the LEAST operational effort?

  • A. Write a Git pre-commit hook that runs the tests before every commit. Ensure that each developer who is working on the project has the pre-commit hook installed locally. Review the test report and resolve any issues before pushing changes to AWS CodeCommit.
  • B. Add a new stage to the pipeline. Use AWS CodeBuild as the provider. Add the new stage after the stage that deploys code revisions to the test environment. Write a buildspec that fails the CodeBuild stage if any test does not pass. Use the test reports feature of CodeBuild to integrate the report with the CodeBuild console. View the test results in CodeBuild. Resolve any issues.
  • C. Add a new stage to the pipeline. Use AWS CodeBuild as the provider. Add the new stage before the stage that deploys code revisions to the test environment. Write a buildspec that fails the CodeBuild stage if any test does not pass. Use the test reports feature of CodeBuild to integrate the report with the CodeBuild console. View the test results in CodeBuild. Resolve any issues.
  • D. Add a new stage to the pipeline. Use Jenkins as the provider. Configure CodePipeline to use Jenkins to run the unit tests. Write a Jenkinsfile that fails the stage if any test does not pass. Use the test report plugin for Jenkins to integrate the report with the Jenkins dashboard. View the test results in Jenkins. Resolve any issues.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
k1kavi1
Highly Voted 2 years, 8 months ago
Selected Answer: C
https://aws.amazon.com/blogs/devops/test-reports-with-aws-codebuild/
upvoted 8 times
...
rcaliandro
Most Recent 2 years, 1 month ago
Selected Answer: C
Why some of you guys vote for B? We need to perform tests first and deploy if the tests are ok. So, to integrate tests to the pipeline we can use CodeBuild before the deploy fase (even if the the deploy is in test environment). We have to configure the buildspec saying that if there is at least one failed test, then we have a CodeBuild failure and we stop the deployment. Since we also want a report, we can use the test reports feature of CodeBuild to integrate the report with the CodeBuild console and view the test results in CodeBuild. So, The C is correct!
upvoted 2 times
...
rcaliandro
2 years, 1 month ago
Why some of you guys vote for B? We need to perform tests first and deploy if the tests are ok. So, to integrate tests to the pipeline we can use CodeBuild before the deploy fase (even if the the deploy is in test environment). We have to configure the buildspec saying that if there is at least one failed test, then we have a CodeBuild failure and we stop the deployment. Since we also want a report, we can use the test reports feature of CodeBuild to integrate the report with the CodeBuild console and view the test results in CodeBuild. So, The C is correct!
upvoted 1 times
...
Syre
2 years, 3 months ago
Selected Answer: B
Answer is B. Option C is similar to option B, but it adds the new stage before the stage that deploys code revisions to the test environment. This approach might be useful if the developer wants to ensure that only code revisions that pass the unit tests are deployed to the test environment. However, this approach requires more configuration than option B.
upvoted 1 times
...
capesignalfreer
2 years, 4 months ago
Selected Answer: C
C has less operational effort than B because unit tests are run before deployment.
upvoted 1 times
...
MMaquis
2 years, 5 months ago
Selected Answer: C
It is generally recommended to run unit tests before deploying code revisions to the test environment. This allows you to catch and fix any issues in the code before they are deployed to the test environment and potentially cause problems for other team members or stakeholders who are relying on that environment. Therefore, option C is the correct answer to the question "Which solution will meet this requirement with the LEAST operational effort?" as it adds a new stage to the pipeline using AWS CodeBuild as the provider and runs the unit tests before deploying the code revisions to the test environment. This approach allows you to catch and fix any issues with the code before they are deployed to the test environment and helps to ensure that your test environment remains stable and reliable for other team members or stakeholders to use.
upvoted 2 times
...
jra777
2 years, 5 months ago
Selected Answer: C
cccccc
upvoted 1 times
...
m4r0ck
2 years, 5 months ago
Selected Answer: B
B: you cant' do a unit test for a code that isn't deployed yet
upvoted 2 times
jra777
2 years, 5 months ago
that is false, thas the whole reason of CI. you instantiate a test environment previous to deployment, can be a container or whatever you need, its a pretty basic pipeline structure
upvoted 2 times
...
...
ShriniW
2 years, 5 months ago
Selected Answer: C
Though its C the option B and C are repeated.
upvoted 1 times
isshin
2 years, 5 months ago
No they are not read carefully. 'b' is after the deployment and 'c' is before.
upvoted 1 times
...
...
Krt5894
2 years, 5 months ago
Selected Answer: C
Should be C
upvoted 1 times
...
sichilam
2 years, 6 months ago
C it is
upvoted 1 times
...
Duded12121
2 years, 6 months ago
Selected Answer: C
CCCCCCCCCCCC
upvoted 1 times
...
fabriciollf
2 years, 7 months ago
Selected Answer: C
C is the correct answer here, we dont need to deploy the application to the test enviroment in order to execute unit tests.
upvoted 3 times
...
fswklotto1
2 years, 7 months ago
Selected Answer: C
Vote for C
upvoted 2 times
...
hamimelon
2 years, 8 months ago
Pretty sure it's C
upvoted 1 times
...
SoMaL69
2 years, 8 months ago
Selected Answer: B
I believe it should be B. As we need deploy app to test env first and then run unit tests
upvoted 3 times
bindukas
2 years, 8 months ago
But it's unit tests, not e2e tests. Why do we need env for unit tests?
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...