From 2062b0bc56e21f8f233ccdb985531be1341e975e Mon Sep 17 00:00:00 2001 From: bajajnehaa Date: Tue, 1 Oct 2024 17:22:40 +0000 Subject: [PATCH 1/3] test populate-secrets --- .kokoro/populate-secrets.sh | 1 + .kokoro/presubmit/acceptance.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh index aab0ec38634d..2823faa7d5dc 100644 --- a/.kokoro/populate-secrets.sh +++ b/.kokoro/populate-secrets.sh @@ -68,6 +68,7 @@ do --secret $key > \ "$SECRET_LOCATION/$key" if [[ $? == 0 ]]; then + cat ${SECRET_LOCATION}/${key} msg "Secret written to ${SECRET_LOCATION}/${key}" else msg "Error retrieving secret ${key}" diff --git a/.kokoro/presubmit/acceptance.cfg b/.kokoro/presubmit/acceptance.cfg index 93a92eaa0842..bc8549dabffb 100644 --- a/.kokoro/presubmit/acceptance.cfg +++ b/.kokoro/presubmit/acceptance.cfg @@ -29,7 +29,7 @@ env_vars: { env_vars: { key: "SECRET_MANAGER_KEYS" - value: "" + value: "client-library-test-universe-storage-location" } env_vars: { From aef1d1789c41713dc6dc2f81197edb4ddb7205b1 Mon Sep 17 00:00:00 2001 From: bajajnehaa Date: Tue, 1 Oct 2024 17:35:44 +0000 Subject: [PATCH 2/3] test if the value is passed to ruby script --- .kokoro/populate-secrets.sh | 1 - .../acceptance/storage/universe_domain_test.rb | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 google-cloud-storage/acceptance/storage/universe_domain_test.rb diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh index 2823faa7d5dc..aab0ec38634d 100644 --- a/.kokoro/populate-secrets.sh +++ b/.kokoro/populate-secrets.sh @@ -68,7 +68,6 @@ do --secret $key > \ "$SECRET_LOCATION/$key" if [[ $? == 0 ]]; then - cat ${SECRET_LOCATION}/${key} msg "Secret written to ${SECRET_LOCATION}/${key}" else msg "Error retrieving secret ${key}" diff --git a/google-cloud-storage/acceptance/storage/universe_domain_test.rb b/google-cloud-storage/acceptance/storage/universe_domain_test.rb new file mode 100644 index 000000000000..b07e7d753e9b --- /dev/null +++ b/google-cloud-storage/acceptance/storage/universe_domain_test.rb @@ -0,0 +1,4 @@ +require "storage_helper" + +puts "KOKORO_GFILE_DIR: #{ENV['KOKORO_GFILE_DIR']}" +# ENV["TEST_UNIVERSE_DOMAIN_CREDENTIAL"]=File.read(File.realpath(${KOKORO_GFILE_DIR}/secret_manager/client-library-test-universe-storage-location)) \ No newline at end of file From f22db8698a7aad394708a1edc545444b3e451ee8 Mon Sep 17 00:00:00 2001 From: bajajnehaa Date: Tue, 1 Oct 2024 17:48:38 +0000 Subject: [PATCH 3/3] check value --- .../acceptance/storage/universe_domain_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/universe_domain_test.rb b/google-cloud-storage/acceptance/storage/universe_domain_test.rb index b07e7d753e9b..728851273aa8 100644 --- a/google-cloud-storage/acceptance/storage/universe_domain_test.rb +++ b/google-cloud-storage/acceptance/storage/universe_domain_test.rb @@ -1,4 +1,5 @@ require "storage_helper" -puts "KOKORO_GFILE_DIR: #{ENV['KOKORO_GFILE_DIR']}" -# ENV["TEST_UNIVERSE_DOMAIN_CREDENTIAL"]=File.read(File.realpath(${KOKORO_GFILE_DIR}/secret_manager/client-library-test-universe-storage-location)) \ No newline at end of file +location=File.read(File.realpath(File.join(ENV["KOKORO_GFILE_DIR"], "secret_manager", "client-library-test-universe-storage-location"))) + +puts "location: #{location}" \ No newline at end of file