Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam DOP-C02 Topic 6 Question 40 Discussion

Actual exam question for Amazon's DOP-C02 exam
Question #: 40
Topic #: 6
[All DOP-C02 Questions]

A software team is using AWS CodePipeline to automate its Java application release pipeline The pipeline consists of a source stage, then a build stage, and then a deploy stage. Each stage contains a single action that has a runOrder value of 1.

The team wants to integrate unit tests into the existing release pipeline. The team needs a solution that deploys only the code changes that pass all unit tests.

Which solution will meet these requirements?

Show Suggested Answer Hide Answer
Suggested Answer: B

* Modify the Build Stage to Add a Test Action with a RunOrder Value of 2:

The build stage in AWS CodePipeline can have multiple actions. By adding a test action with a runOrder value of 2, the test action will execute after the initial build action completes.

* Use AWS CodeBuild as the Action Provider to Run Unit Tests:

AWS CodeBuild is a fully managed build service that compiles source code, runs tests, and produces software packages.

Using CodeBuild to run unit tests ensures that the tests are executed in a controlled environment and that only the code changes that pass the unit tests proceed to the deploy stage.

Example configuration in CodePipeline:

{

'name': 'BuildStage',

'actions': [

{

'name': 'Build',

'actionTypeId': {

'category': 'Build',

'owner': 'AWS',

'provider': 'CodeBuild',

'version': '1'

},

'runOrder': 1

},

{

'name': 'Test',

'actionTypeId': {

'category': 'Test',

'owner': 'AWS',

'provider': 'CodeBuild',

'version': '1'

},

'runOrder': 2

}

]

}

By integrating the unit tests into the build stage and ensuring they run after the build process, the pipeline guarantees that only code changes passing all unit tests are deployed.


AWS CodePipeline

AWS CodeBuild

Using CodeBuild with CodePipeline

Contribute your Thoughts:

Micaela
1 days ago
Definitely B. Running the tests in the build stage ensures that only the code that passes all the checks gets deployed. Can't afford any buggy releases, am I right?
upvoted 0 times
...
Carolann
3 days ago
Whoa, hold up! Wouldn't it be hilarious if they tried to run the tests in the deploy stage? That's like putting the cart before the horse, am I right? I vote for B.
upvoted 0 times
...
Ines
10 days ago
Hmm, I'm not sure about that. I was thinking C might be the better option, where we add the test action with a runOrder of 1 in the deploy stage using AWS CodeDeploy.
upvoted 0 times
...
Rachael
14 days ago
But A uses AWS CodeDeploy to run unit tests, which makes more sense in this scenario.
upvoted 0 times
...
Alex
15 days ago
I think the answer is B. Modifying the build stage and adding a test action with a runOrder of 2 using AWS CodeBuild makes the most sense to me.
upvoted 0 times
Merri
1 days ago
I agree, using AWS CodeBuild for running unit tests in the build stage seems like the right approach.
upvoted 0 times
...
Talia
6 days ago
I think the answer is B. Modifying the build stage and adding a test action with a runOrder of 2 using AWS CodeBuild makes the most sense to me.
upvoted 0 times
...
...
Francesco
17 days ago
I disagree, I believe the correct answer is B.
upvoted 0 times
...
Rachael
22 days ago
I think the answer is A.
upvoted 0 times
...

Save Cancel