Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[storage] fix: use a different bucket for requester_pays_test #3655

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 4 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/decrypt-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ROOT=$( dirname "$DIR" )
# Work from the project root.
cd $ROOT

openssl aes-256-cbc -k "$1" -in testing/secrets.tar.enc -out secrets.tar -d
openssl aes-256-cbc -k "$1" -md sha256 \
-in testing/secrets.tar.enc -out secrets.tar -d
tar xvf secrets.tar
rm secrets.tar
5 changes: 2 additions & 3 deletions scripts/encrypt-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ read -s -p "Enter password for encryption: " PASSWORD
echo

tar cvf secrets.tar testing/{service-account.json,client-secrets.json,test-env.sh}
openssl aes-256-cbc -k "$PASSWORD" -in secrets.tar -out testing/secrets.tar.enc
openssl aes-256-cbc -k "$PASSWORD" -md sha256 \
-in secrets.tar -out testing/secrets.tar.enc
rm secrets.tar

travis encrypt "SECRETS_PASSWORD=$PASSWORD" --add --override
10 changes: 10 additions & 0 deletions storage/cloud-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

For requester_pays_test.py, we need to use a different Storage bucket.

The test looks for an environment variable `REQUESTER_PAYS_TEST_BUCKET`.

Also, the service account for the test needs to have `Billing Project
Manager` role in order to make changes on buckets with requester pays
enabled.

We added that role to the test service account.
4 changes: 3 additions & 1 deletion storage/cloud-client/requester_pays_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import storage_download_file_requester_pays
import storage_get_requester_pays_status

BUCKET = os.environ["CLOUD_STORAGE_BUCKET"]

# We use a different bucket from other tests.
BUCKET = os.environ["REQUESTER_PAYS_TEST_BUCKET"]
PROJECT = os.environ["GCLOUD_PROJECT"]


Expand Down
Binary file modified testing/secrets.tar.enc
Binary file not shown.
1 change: 1 addition & 0 deletions testing/test-env.tmpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export GOOGLE_CLOUD_PROJECT=$GCLOUD_PROJECT
export FIRESTORE_PROJECT=

export CLOUD_STORAGE_BUCKET=$GCLOUD_PROJECT
export REQUESTER_PAYS_TEST_BUCKET="${CLOUD_STORAGE_BUCKET}-requester-pays-test"
export API_KEY=
export BIGTABLE_CLUSTER=bigtable-test
export BIGTABLE_ZONE=us-central1-c
Expand Down