-
Notifications
You must be signed in to change notification settings - Fork 0
Anywhere cache samples v2 #39
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
base: main
Are you sure you want to change the base?
Changes from 29 commits
877b90a
e036c60
33a8d55
7f5d121
1dcd5bb
f99baa4
65d5833
d8498e4
842bdf2
bd0b9cd
3b9cda3
feb8f47
af3c7ef
e69000b
808d1e9
54f2c14
7edf04d
4b4d0a6
90f3a0b
93af0da
2b29efc
b78928f
b6020d3
fecdaa6
78b6dbf
cecd6d9
2b508ea
ed9c641
3dace3d
3a70b81
ace1464
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| require_relative "helper" | ||
| require "google/cloud/storage/control" | ||
| require_relative "../storage_control_create_anywhere_cache" | ||
| require_relative "../storage_control_list_anywhere_caches" | ||
| require_relative "../storage_control_get_anywhere_cache" | ||
| require_relative "../storage_control_update_anywhere_cache" | ||
| require_relative "../storage_control_pause_anywhere_cache" | ||
| require_relative "../storage_control_resume_anywhere_cache" | ||
| require_relative "../storage_control_disable_anywhere_cache" | ||
|
|
||
| describe "Storage Control Anywhere Cache" do | ||
| let(:bucket_name) { random_bucket_name } | ||
| let(:zone) { "us-east1-b" } | ||
| # Set project to "_" to signify global bucket | ||
| let(:anywhere_cache_name) { "projects/_/buckets/#{bucket_name}/anywhereCaches/#{zone}" } | ||
|
|
||
| before :all do | ||
| @bucket = create_bucket_helper bucket_name | ||
| end | ||
|
|
||
| after do | ||
| delete_bucket_helper bucket_name until count_anywhere_caches bucket_name | ||
| end | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cleanup logic in this |
||
|
|
||
| it "handles Anywhere cache lifecycle in sequence" do | ||
| out_create, _err = capture_io do | ||
| create_anywhere_cache bucket_name: bucket_name, zone: zone | ||
| end | ||
| assert_includes out_create, "AnywhereCache created - #{anywhere_cache_name}" | ||
|
|
||
| out_list, _err = capture_io do | ||
| list_anywhere_caches bucket_name: bucket_name | ||
| end | ||
| assert_includes out_list, "AnywhereCache #{anywhere_cache_name} found in list" | ||
|
|
||
| out_get, _err = capture_io do | ||
| get_anywhere_cache bucket_name: bucket_name, anywhere_cache_id: zone | ||
| end | ||
| assert_includes out_get, "AnywhereCache #{anywhere_cache_name} fetched" | ||
|
|
||
| out_update, _err = capture_io do | ||
| update_anywhere_cache bucket_name: bucket_name, anywhere_cache_id: zone | ||
| end | ||
| assert_includes out_update, "AnywhereCache #{anywhere_cache_name} updated" | ||
|
|
||
| out_pause, _err = capture_io do | ||
| pause_anywhere_cache bucket_name: bucket_name, anywhere_cache_id: zone | ||
| end | ||
| assert_includes out_pause, "AnywhereCache #{anywhere_cache_name} paused" | ||
|
|
||
| out_resume, _err = capture_io do | ||
| resume_anywhere_cache bucket_name: bucket_name, anywhere_cache_id: zone | ||
| end | ||
| assert_includes out_resume, "AnywhereCache #{anywhere_cache_name} running" | ||
|
|
||
| out_disable, _err = capture_io do | ||
| disable_anywhere_cache bucket_name: bucket_name, anywhere_cache_id: zone | ||
| end | ||
| assert_includes out_disable, "AnywhereCache #{anywhere_cache_name} disabled" | ||
| end | ||
| end | ||
|
|
||
| def count_anywhere_caches bucket_name | ||
| sleep 900 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new( | ||
| parent: parent | ||
| ) | ||
| result = storage_control_client.list_anywhere_caches request | ||
| result.response.anywhere_caches.count | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_create_anywhere_cache] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def create_anywhere_cache bucket_name:, zone: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # Zone where you want to create cache | ||
| # zone = "your-zone-name" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| name = "#{parent}/anywhereCaches/#{zone}" | ||
|
|
||
| anywhere_cache = Google::Cloud::Storage::Control::V2::AnywhereCache.new( | ||
| name: name, | ||
| zone: zone | ||
| ) | ||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new( | ||
| parent: parent, | ||
| anywhere_cache: anywhere_cache | ||
| ) | ||
| # The request creates a new cache in the specified zone. | ||
| # The cache is created in the specified bucket. | ||
| begin | ||
| operation = storage_control_client.create_anywhere_cache request | ||
| if operation.instance_of? Gapic::Operation | ||
| puts "AnywhereCache operation created - #{operation.name}" | ||
| get_request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new( | ||
| name: name | ||
| ) | ||
| result = storage_control_client.get_anywhere_cache get_request | ||
| until result.state == "running" | ||
| sleep 1800 # Wait for 1/2 hour before checking again | ||
| result = storage_control_client.get_anywhere_cache get_request | ||
| puts "AnywhereCache status check retried" | ||
| end | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The polling loop to check for cache creation status includes puts "AnywhereCache operation created - #{operation.name}, waiting for it to complete."
operation.wait_until_done!
raise operation.error if operation.error?
result = operation.result |
||
| puts "AnywhereCache created - #{result.name}" | ||
| else | ||
| puts "AnywhereCache create operation failed" | ||
| end | ||
| rescue StandardError => e | ||
| puts "Error creating AnywhereCache: #{e.message}" | ||
| end | ||
|
Comment on lines
+42
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation for handling the long-running operation is not ideal. Sleeping for a fixed hour is inefficient and provides a poor user experience. The client library provides a much better way to handle this using This method polls the operation status with exponential backoff and also simplifies error handling. Additionally, rescuing The output messages could also be more descriptive. begin
operation = storage_control_client.create_anywhere_cache request
puts "Waiting for Anywhere Cache creation operation to complete... (name: #{operation.name})"
operation.wait_until_done!
if operation.error?
puts "Error creating AnywhereCache: #{operation.error.message}"
else
puts "AnywhereCache created: #{operation.response.name}"
end
rescue Google::Cloud::Error => e
puts "Error creating AnywhereCache: #{e.message}"
end |
||
| end | ||
| # [END storage_control_create_anywhere_cache] | ||
| create_anywhere_cache bucket_name: ARGV.shift, zone: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_disable_anywhere_cache] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def disable_anywhere_cache bucket_name:, anywhere_cache_id: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # A value that, along with the bucket's name, uniquely identifies the cache | ||
| # anywhere_cache_id = "us-east1-b" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| name = "#{parent}/anywhereCaches/#{anywhere_cache_id}" | ||
|
|
||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new( | ||
| name: name | ||
| ) | ||
| # The request disables the cache, but does not delete it. | ||
| # The cache can be re-enabled later. | ||
| begin | ||
| result = storage_control_client.disable_anywhere_cache request | ||
| puts "AnywhereCache #{result.name} #{result.state} " | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The operation = storage_control_client.disable_anywhere_cache request
puts "Waiting for disable operation to complete..."
operation.wait_until_done!
raise operation.error if operation.error?
result = operation.result
puts "AnywhereCache #{result.name} #{result.state}" |
||
| rescue StandardError => e | ||
| puts "Error disabling AnywhereCache: #{e.message}" | ||
| end | ||
|
Comment on lines
+37
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block can be improved by:
begin
result = storage_control_client.disable_anywhere_cache request
puts "AnywhereCache #{result.name} is now #{result.state.to_s.downcase}."
rescue Google::Cloud::Error => e
puts "Error disabling AnywhereCache: #{e.message}"
end |
||
| end | ||
| # [END storage_control_disable_anywhere_cache] | ||
| disable_anywhere_cache bucket_name: ARGV.shift, anywhere_cache_id: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_get_anywhere_cache] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def get_anywhere_cache bucket_name:, anywhere_cache_id: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # A value that, along with the bucket's name, uniquely identifies the cache | ||
| # anywhere_cache_id = "us-east1-b" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| name = "#{parent}/anywhereCaches/#{anywhere_cache_id}" | ||
|
|
||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new( | ||
| name: name | ||
| ) | ||
| # The request retrieves the cache in the specified bucket. | ||
| # The cache is identified by the specified ID. | ||
| # The cache is in the specified bucket. | ||
|
|
||
| begin | ||
| result = storage_control_client.get_anywhere_cache request | ||
| puts "AnywhereCache #{result.name} fetched" | ||
| rescue StandardError => e | ||
| puts "Error fetching AnywhereCache: #{e.message}" | ||
| end | ||
|
Comment on lines
+39
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block can be improved by:
begin
result = storage_control_client.get_anywhere_cache request
puts "Fetched AnywhereCache:"
puts "- Name: #{result.name}"
puts "- State: #{result.state}"
puts "- TTL: #{result.ttl.seconds} seconds"
rescue Google::Cloud::Error => e
puts "Error fetching AnywhereCache: #{e.message}"
end |
||
| end | ||
| # [END storage_control_get_anywhere_cache] | ||
| get_anywhere_cache bucket_name: ARGV.shift, anywhere_cache_id: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_list_anywhere_caches] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def list_anywhere_caches bucket_name: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
|
|
||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new( | ||
| parent: parent | ||
| ) | ||
| # The request lists all caches in the specified bucket. | ||
| # The caches are identified by the specified bucket name. | ||
| begin | ||
| result = storage_control_client.list_anywhere_caches request | ||
| result.response.anywhere_caches.each do |item| | ||
| puts "AnywhereCache #{item.name} found in list" | ||
| end | ||
| rescue StandardError => e | ||
| puts "Error listing AnywhereCaches: #{e.message}" | ||
| end | ||
|
Comment on lines
+33
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation I also suggest improving the output to be more user-friendly and rescuing a more specific error type than begin
puts "Listing Anywhere Caches for bucket \"#{bucket_name}\"..."
result = storage_control_client.list_anywhere_caches request
result.each do |cache|
puts cache.name
end
rescue Google::Cloud::Error => e
puts "Error listing AnywhereCaches: #{e.message}"
end |
||
| end | ||
| # [END storage_control_list_anywhere_caches] | ||
| list_anywhere_caches bucket_name: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_pause_anywhere_cache] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def pause_anywhere_cache bucket_name:, anywhere_cache_id: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # A value that, along with the bucket's name, uniquely identifies the cache | ||
| # anywhere_cache_id = "us-east1-b" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| # Set project to "_" to signify global bucket | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| name = "#{parent}/anywhereCaches/#{anywhere_cache_id}" | ||
|
|
||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new( | ||
| name: name | ||
| ) | ||
| # The request pauses the cache, but does not delete it. | ||
| # The cache can be resumed later. | ||
| # The cache is paused in the specified bucket. | ||
| begin | ||
| result = storage_control_client.pause_anywhere_cache request | ||
| puts "AnywhereCache #{result.name} #{result.state}" | ||
|
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The operation = storage_control_client.pause_anywhere_cache request
puts "Waiting for pause operation to complete..."
operation.wait_until_done!
raise operation.error if operation.error?
result = operation.result
puts "AnywhereCache #{result.name} #{result.state}" |
||
| rescue StandardError => e | ||
| puts "Error pausing AnywhereCache: #{e.message}" | ||
| end | ||
|
Comment on lines
+38
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block can be improved by:
begin
result = storage_control_client.pause_anywhere_cache request
puts "AnywhereCache #{result.name} is now #{result.state.to_s.downcase}."
rescue Google::Cloud::Error => e
puts "Error pausing AnywhereCache: #{e.message}"
end |
||
| end | ||
| # [END storage_control_pause_anywhere_cache] | ||
| pause_anywhere_cache bucket_name: ARGV.shift, anywhere_cache_id: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # [START storage_control_resume_anywhere_cache] | ||
| require "google/cloud/storage/control" | ||
|
|
||
| def resume_anywhere_cache bucket_name:, anywhere_cache_id: | ||
| # The ID of your GCS bucket | ||
| # bucket_name = "your-unique-bucket-name" | ||
|
|
||
| # A value that, along with the bucket's name, uniquely identifies the cache | ||
| # anywhere_cache_id = "us-east1-b" | ||
|
|
||
| # Create a client object. The client can be reused for multiple calls. | ||
| storage_control_client = Google::Cloud::Storage::Control.storage_control | ||
| parent = "projects/_/buckets/#{bucket_name}" | ||
| # Set project to "_" to signify global bucket | ||
| name = "#{parent}/anywhereCaches/#{anywhere_cache_id}" | ||
|
|
||
| # Create a request. | ||
| request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new( | ||
| name: name | ||
| ) | ||
| # The request resumes the cache, which was previously paused. | ||
| # The cache is resumed in the specified bucket. | ||
| # The cache is identified by the specified ID. | ||
| begin | ||
| result = storage_control_client.resume_anywhere_cache request | ||
| puts "AnywhereCache #{result.name} #{result.state}" | ||
|
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The operation = storage_control_client.resume_anywhere_cache request
puts "Waiting for resume operation to complete..."
operation.wait_until_done!
raise operation.error if operation.error?
result = operation.result
puts "AnywhereCache #{result.name} #{result.state}" |
||
| rescue StandardError => e | ||
| puts "Error resuming AnywhereCache: #{e.message}" | ||
| end | ||
|
Comment on lines
+38
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block can be improved by:
begin
result = storage_control_client.resume_anywhere_cache request
puts "AnywhereCache #{result.name} has been resumed and is now #{result.state.to_s.downcase}."
rescue Google::Cloud::Error => e
puts "Error resuming AnywhereCache: #{e.message}"
end |
||
| end | ||
| # [END storage_control_resume_anywhere_cache] | ||
| resume_anywhere_cache bucket_name: ARGV.shift, anywhere_cache_id: ARGV.shift if $PROGRAM_NAME == __FILE__ | ||
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.
This
before :allblock has a few issues:storage_clientandbucket_name, which are defined withletand are not available in abefore :allcontext. This will cause the test setup to fail. You should use abefore(orbefore :each) block instead.@bucketis immediately reassigned on the next line.