Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Cloud Developer Exam - Topic 4 Question 116 Discussion

You are using Cloud Build to build a Docker image. You need to modify the build to execute unit and runintegration tests. When there is a failure, you want the build history to clearly display the stage at which thebuild failed.What should you do?
D) Create a Cloud Build build config file with separate cloud builder steps to compile and execute unit and integration tests.
B) Create a Cloud Build build config file with a single build step to compile unit and integration tests.
A) Add RUN commands in the Dockerfile to execute unit and integration tests.
C) Create a Cloud Build build config file that will spawn a separate cloud build pipeline for unit and integration tests.

Google Professional Cloud Developer Exam - Topic 4 Question 116 Discussion

Actual exam question for Google's Professional Cloud Developer exam
Question #: 116
Topic #: 4
[All Professional Cloud Developer Questions]

You are using Cloud Build to build a Docker image. You need to modify the build to execute unit and run

integration tests. When there is a failure, you want the build history to clearly display the stage at which the

build failed.

What should you do?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

0/2000 characters
Mollie
26 days ago
I think we should add a test stage in the Cloud Build config.
upvoted 0 times
...
Dong
1 month ago
I thought Cloud Build only showed the final result, not stages?
upvoted 0 times
...
Nguyet
1 month ago
Make sure to use the right logging for better visibility.
upvoted 0 times
...
Mona
1 month ago
Wait, can you really see the exact stage of failure?
upvoted 0 times
...
Ashleigh
2 months ago
Totally agree, that’s the best way to track failures!
upvoted 0 times
...
Gilberto
2 months ago
Just add a testing step in your Cloud Build config.
upvoted 0 times
...
Alyce
2 months ago
Haha, I bet the answer involves using the `gcloud` command-line tool. That's always the solution, isn't it?
upvoted 0 times
...
Bok
2 months ago
Isn't there a way to set up custom build steps to run the tests and handle the failure reporting?
upvoted 0 times
...
Val
2 months ago
The `--status=FAILURE` option should give us the stage where the build failed.
upvoted 0 times
...
Lemuel
2 months ago
I think we should use the `--failure-detail` flag to get more information on the build failure.
upvoted 0 times
...
Twana
3 months ago
I think we should use the `--fail-fast` option or something similar to stop the build on the first failure, but I’m not 100% clear on how that integrates with Cloud Build.
upvoted 0 times
...
Truman
3 months ago
I’m a bit confused about how to handle failures in the build process. Do we need to set up a specific command to fail the build if the tests don’t pass?
upvoted 0 times
...
Gladys
4 months ago
I remember practicing a similar question where we had to set up different build steps. We might need to use the `steps` section to define the test commands.
upvoted 0 times
...
Leah
4 months ago
I think we need to add a step in the Cloud Build configuration to run the tests after the image is built, but I'm not entirely sure how to specify that in the YAML file.
upvoted 0 times
...
Pamella
4 months ago
I'm a bit confused on how to set the 'failure_condition' properly. I'll need to double-check the syntax and make sure I'm handling any test failures correctly.
upvoted 0 times
...
Brandee
4 months ago
Good idea, Michael. That way the build history will clearly show where the build failed. I'm going to try that approach and see if I can get it working.
upvoted 0 times
...
Elly
4 months ago
Okay, I think I've got a plan. I'll add a 'test' step that runs the unit and integration tests, and then set the 'failure_condition' property to indicate that the build should fail if any of the tests fail.
upvoted 0 times
...
Elmer
4 months ago
Hmm, I'm not sure how to set that up in Cloud Build. I'll need to review the documentation on the available build steps and how to configure them.
upvoted 0 times
...
Rodolfo
5 months ago
This seems straightforward. I'd start by adding a test stage to the build config to run the unit and integration tests.
upvoted 0 times
...

Save Cancel