Your team is developing a Cloud Function triggered by Cloud Storage events. You want to accelerate testing and development of your Cloud Function while following Google-recommended best practices. What should you do?
A.
Create a new Cloud Function that is triggered when Cloud Audit Logs detects the cloudfunctions.functions.sourceCodeSet operation in the original Cloud Function. Send mock requests to the new function to evaluate the functionality.
B.
Make a copy of the Cloud Function, and rewrite the code to be HTTP-triggered. Edit and test the new version by triggering the HTTP endpoint. Send mock requests to the new function to evaluate the functionality.
C.
Install the Functions Frameworks library, and configure the Cloud Function on localhost. Make a copy of the function, and make edits to the new version. Test the new version using curl.
D.
Make a copy of the Cloud Function in the Google Cloud console. Use the Cloud console's in-line editor to make source code changes to the new function. Modify your web application to call the new function, and test the new version in production
Making a copy of the function for edits ensures that your changes do not affect the original function in production. It provides a controlled environment for development and testing.
curl Testing:
Testing the new version using curl is a simple and effective way to send mock requests and evaluate the functionality of your Cloud Function locally.
Using the Functions Frameworks library and local testing provides a development environment that is both efficient and aligned with Google-recommended best practices for Cloud Functions development.
Not B because
"Local testing
Many development paradigms depend on being able to test your code relatively quickly.
Because testing code on Cloud Functions itself involves waiting for deployed code and log entries to become available, running and testing your function on your development machine can make the testing process (and, in turn, the development process) significantly faster."
C because: https://cloud.google.com/functions/docs/running/function-frameworks
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.
braska
5 months agopurushi
8 months, 2 weeks agoAlizCert
8 months, 4 weeks agocloser89
1 year agoPime13
1 year, 1 month agoTNT87
1 year, 2 months agoTNT87
1 year, 2 months ago