Skip to content

Commit

Permalink
putting sytem vars in integration.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhangi-google committed Sep 30, 2024
1 parent b749474 commit 60e87d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .kokoro/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ for ruby_version in "${ruby_versions[@]}"; do
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

# Universe Domain Test project Credentials
export TEST_UNIVERSE_DOMAIN_CREDENTIAL=$(realpath ${KOKORO_GFILE_DIR}/secret_manager/client-library-test-universe-domain-credential)
export TEST_UNIVERSE_DOMAIN=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-domain)
export TEST_UNIVERSE_PROJECT_ID=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-project-id)
export TEST_UNIVERSE_LOCATION=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-storage-location)


gem install --no-document toys

toys ci -v --load-kokoro-context $EXTRA_CI_ARGS < /dev/null
Expand Down
22 changes: 5 additions & 17 deletions google-cloud-storage/acceptance/storage/universe_domain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,16 @@

describe Google::Cloud::Storage do

system(
"export TEST_UNIVERSE_DOMAIN_CREDENTIAL=$(realpath ${KOKORO_GFILE_DIR}/secret_manager/client-library-test-universe-domain-credential)
export TEST_UNIVERSE_DOMAIN=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-domain)
export TEST_UNIVERSE_PROJECT_ID=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-project-id)
export TEST_UNIVERSE_LOCATION=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-storage-location)"
)

# Universe Domain Test project Credentials
$test_universe_domain = ENV["TEST_UNIVERSE_DOMAIN"]
$test_universe_project_id = ENV["TEST_UNIVERSE_PROJECT_ID"]
$test_universe_location = ENV["TEST_UNIVERSE_LOCATION"]
$test_universe_domain_credential = ENV["TEST_UNIVERSE_DOMAIN_CREDENTIAL"]

let :storage do
# Universe Domain Test project Credentials
Google::Cloud::Storage.new(
project_id: $test_universe_project_id,
credentials: $test_universe_domain_credential,
universe_domain: $test_universe_domain
project_id: ENV["TEST_UNIVERSE_PROJECT_ID"],
credentials: ENV["TEST_UNIVERSE_DOMAIN_CREDENTIAL"],
universe_domain: ENV["TEST_UNIVERSE_DOMAIN"]
)
end
let(:bucket_name) { $bucket_names.first }
let(:bucket_location) { $test_universe_location }
let(:bucket_location) { ENV["TEST_UNIVERSE_LOCATION"] }
let :bucket do
storage.bucket(bucket_name) || safe_gcs_execute { storage.create_bucket bucket_name, location: bucket_location }
end
Expand Down

0 comments on commit 60e87d5

Please sign in to comment.