Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
merged 8 commits into from
Jun 3, 2021

Conversation

tritone
Copy link
Contributor

@tritone tritone commented Jun 2, 2021

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

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
@tritone tritone requested review from a team as code owners June 2, 2021 19:45
@snippet-bot
Copy link

snippet-bot bot commented Jun 2, 2021

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jun 2, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 2, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jun 2, 2021
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @tritone!

@cojenco
Copy link
Contributor

cojenco commented Jun 2, 2021

Thanks for the fix @tritone!

@tritone
Copy link
Contributor Author

tritone commented Jun 2, 2021

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"]
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@leahecole leahecole added the automerge Merge the pull request once unit tests and other checks pass. label Jun 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit e16ff67 into GoogleCloudPlatform:master Jun 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 3, 2021
lesv pushed a commit to GoogleCloudPlatform/java-docs-samples that referenced this pull request Jun 8, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage.s3-sdk.list_gcs_objects_test: test_list_blobs failed storage.s3-sdk.list_gcs_buckets_test: test_list_blobs failed
6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.