-
Notifications
You must be signed in to change notification settings - Fork 6.5k
E2E tests for Cloud Run hello-broken and logging-manual samples #3971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
run/logging-manual/e2e_test.py
Outdated
assert entries | ||
|
||
|
||
def stackdriver_request(service_name, project, access_token): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why not use client library?
- I notice no retries, it's been found necessary in Node.js and Golang to avoid flakiness:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to add retries.
Updated to the client library. The reason why I didn't use it as first is because doing the direct HTTP calls is generally easier. The documentation for the client libraries is often not great. By contrast, I can use the API explorer to figure out the correct API call and then copy the HTTP request from the UI.
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a | ||
# build specific Cloud project. You can also use your own string | ||
# to use your own Cloud project. | ||
'gcloud_project_env': 'GCLOUD_PROJECT', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCLOUD_PROJECT
is deprecated in GAE at least, in favor of GOOGLE_CLOUD_PROJECT
which I see used elsewhere in this PR. Should this be standardized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GoogleCloudPlatform/python-samples-owners We should probably switch to GOOGLE_CLOUD_PROJECT in this repo. Opened #4019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Tests for hello-broken and logging-manual.
Original plan was to do all the e2e-tests in one PR, but the logging-manual one got a little more complicated.
Using the Stackdriver API to check that the message logged properly, as this is the main feature of the sample & tutorial. I can be convinced to use the python client instead of the HTTP call.