-
Notifications
You must be signed in to change notification settings - Fork 6.6k
test(storage): fix S3 SDK tests #6074
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
These tests are currently failing because credentials have expired. This change rewrites the tests to create their own HMAC Key rather than relying on keys in a separate project. Fixes GoogleCloudPlatform#5906 Fixes GoogleCloudPlatform#5907
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
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.
Awesome, thanks @tritone!
Thanks for the fix @tritone! |
Okay, looks like the CI is now passing. Could someone from @GoogleCloudPlatform/python-samples-owners take a look? Side note, this will allow the project GOOGLE_CLOUD_PROJECT_S3_SDK to be removed, and this env var as well as STORAGE_HMAC_ACCESS_KEY_ID and STORAGE_HMAC_ACCESS_SECRET_KEY can be removed from the kokoro config. |
import list_gcs_objects | ||
|
||
|
||
PROJECT_ID = os.environ["MAIN_GOOGLE_CLOUD_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.
Can _, project_id = google.auth.default()
be used to detect the 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.
What project will that return? We need to use MAIN_GOOGLE_CLOUD_PROJECT
rather than the standard one because we need a permissions exception to have HMAC keys.
* test(storage): fix S3 SDK tests Update S3 SDK Tests to create and use HMAC credentials in the test rather than depending on external credentials. Test has been updated to rely on a Service Account to generate the necessary HMAC credentials. Fixes #5374 Fixes #5375 port of GoogleCloudPlatform/python-docs-samples#6074 * add null assertions to hmac values * fix bucket name resolution remove source of unnecessary storage-hmac-credentials.sh in kokoro config
These tests are currently failing because credentials have
expired. This change rewrites the tests to create their own HMAC
Key rather than relying on keys in a separate project.
Inspired by similar approach in GoogleCloudPlatform/golang-samples#1217
Fixes #5906
Fixes #5907
Checklist
nox -s py-3.6
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)