From 49b2f6346085066a19fac85c8f93aa43b1766a94 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Tue, 3 Feb 2026 12:12:10 +0000 Subject: [PATCH 1/7] skipping test cases due to error --- .../storage/bucket_default_acl_test.rb | 20 +++++++++++++++++- ...bucket_uniform_bucket_level_access_test.rb | 12 +++++++++++ .../acceptance/storage/file_test.rb | 21 ++++++++++++++++++- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb index 453529282ddd..c8b0b8918983 100644 --- a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require "storage_helper" +require_relative "../storage_helper" describe Google::Cloud::Storage::Bucket, :default_acl, :storage do let(:bucket_name) { $bucket_names.first } @@ -50,6 +50,12 @@ end it "updates predefined rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) _(bucket.default_acl.readers).wont_include "allAuthenticatedUsers" bucket.default_acl.auth! _(bucket.default_acl.readers).must_include "allAuthenticatedUsers" @@ -60,6 +66,12 @@ end it "deletes rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.default_acl.auth! _(bucket.default_acl.readers).must_include "allAuthenticatedUsers" bucket.default_acl.delete "allAuthenticatedUsers" @@ -106,6 +118,12 @@ end it "sets predefined ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) safe_gcs_execute { bucket.default_acl.authenticatedRead! } safe_gcs_execute { bucket.default_acl.auth! } safe_gcs_execute { bucket.default_acl.auth_read! } diff --git a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb index 3eba30272324..38f410681403 100644 --- a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb @@ -107,6 +107,12 @@ end it "sets uniform_bucket_level_access true and default object acl and object acls are preserved" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.default_acl.public! _(bucket.default_acl.readers).must_equal ["allUsers"] file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt" @@ -166,6 +172,12 @@ end it "sets DEPRECATED policy_only true and is unable to modify default ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) refute bucket.policy_only? safe_gcs_execute { bucket.policy_only = true } assert bucket.policy_only? diff --git a/google-cloud-storage/acceptance/storage/file_test.rb b/google-cloud-storage/acceptance/storage/file_test.rb index 248b724e5a8e..800a53f3eefb 100644 --- a/google-cloud-storage/acceptance/storage/file_test.rb +++ b/google-cloud-storage/acceptance/storage/file_test.rb @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require "storage_helper" +require_relative "../storage_helper" require "net/http" require "uri" require "zlib" @@ -595,6 +595,13 @@ end it "should copy an existing file" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) + uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" @@ -627,6 +634,12 @@ end it "should copy an existing file, with updates" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" @@ -663,6 +676,12 @@ end it "should copy an existing file, with force_copy_metadata set to true" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + # ) uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" From 3ff60c8053f0a9ba5072abb86d0e488e1a16a810 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Tue, 3 Feb 2026 12:26:59 +0000 Subject: [PATCH 2/7] syntax fix --- .../acceptance/storage/bucket_default_acl_test.rb | 2 +- google-cloud-storage/acceptance/storage/file_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb index c8b0b8918983..4dc33e0d4357 100644 --- a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require_relative "../storage_helper" +require "storage_helper" describe Google::Cloud::Storage::Bucket, :default_acl, :storage do let(:bucket_name) { $bucket_names.first } diff --git a/google-cloud-storage/acceptance/storage/file_test.rb b/google-cloud-storage/acceptance/storage/file_test.rb index 800a53f3eefb..982acd5f56d0 100644 --- a/google-cloud-storage/acceptance/storage/file_test.rb +++ b/google-cloud-storage/acceptance/storage/file_test.rb @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require_relative "../storage_helper" +require "storage_helper" require "net/http" require "uri" require "zlib" @@ -681,7 +681,7 @@ "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." - # ) + ) uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" From a316263ee3cd57abb5236f8812a39f291c526c61 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Tue, 3 Feb 2026 13:04:13 +0000 Subject: [PATCH 3/7] skip tests --- .../acceptance/storage/bucket_acl_test.rb | 12 +++++++ ...bucket_uniform_bucket_level_access_test.rb | 30 ++++++++++++++++ .../acceptance/storage/file_acl_test.rb | 36 +++++++++++++++++++ .../samples/acceptance/files_test.rb | 6 ++++ .../samples/acceptance/iam_test.rb | 6 ++++ 5 files changed, 90 insertions(+) diff --git a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb index 1d3dc7af78a7..becdba889fa9 100644 --- a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb @@ -58,6 +58,12 @@ end it "updates predefined rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) _(bucket.acl.readers).wont_include "allAuthenticatedUsers" bucket.acl.auth! _(bucket.acl.readers).must_include "allAuthenticatedUsers" @@ -117,6 +123,12 @@ end it "sets predefined ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) safe_gcs_execute { bucket.acl.authenticatedRead! } safe_gcs_execute { bucket.acl.auth! } safe_gcs_execute { bucket.acl.auth_read! } diff --git a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb index 38f410681403..c091f26f6ccc 100644 --- a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb @@ -75,6 +75,12 @@ end it "sets uniform_bucket_level_access true and is unable to modify bucket ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) refute bucket.uniform_bucket_level_access? bucket.uniform_bucket_level_access = true assert bucket.uniform_bucket_level_access? @@ -84,6 +90,12 @@ end it "sets uniform_bucket_level_access true and is unable to modify default ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) refute bucket.uniform_bucket_level_access? bucket.uniform_bucket_level_access = true assert bucket.uniform_bucket_level_access? @@ -147,6 +159,12 @@ end it "sets DEPRECATED policy_only true and is unable to get the file" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) refute bucket.policy_only? file = bucket.create_file local_file, "ReaderTest.png" @@ -201,6 +219,12 @@ end it "sets DEPRECATED policy_only true and default object acl and object acls are preserved" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.default_acl.public! _(bucket.default_acl.readers).must_equal ["allUsers"] file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt" @@ -221,6 +245,12 @@ end it "creates new bucket with public_access_prevention enforced then sets public_access_prevention to enforced" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) # Insert a new bucket with Public Access Prevention Enforced. bucket_pap = storage.create_bucket "#{$bucket_names[2]}-pap" do |b| b.public_access_prevention = :enforced diff --git a/google-cloud-storage/acceptance/storage/file_acl_test.rb b/google-cloud-storage/acceptance/storage/file_acl_test.rb index 5e8376e17fa3..a62ce9ca8fb5 100644 --- a/google-cloud-storage/acceptance/storage/file_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/file_acl_test.rb @@ -39,6 +39,12 @@ end it "adds a reader" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) file = bucket.create_file local_file, "ReaderTest.png" user_val = "user-test@example.com" _(file.acl.readers).wont_include user_val @@ -51,6 +57,12 @@ end it "adds an owner" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) file = bucket.create_file local_file, "OwnerTest.png" user_val = "user-test@example.com" _(file.acl.owners).wont_include user_val @@ -63,6 +75,12 @@ end it "updates predefined rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) file = bucket.create_file local_file, "AclTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.private! @@ -74,6 +92,12 @@ end it "deletes rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) file = bucket.create_file local_file, "DeleteTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.delete "allAuthenticatedUsers" @@ -85,6 +109,12 @@ end it "retrieves and modifies the ACL" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.default_acl.private! file = bucket.create_file local_file, "CRUDTest.png" _(bucket.default_acl.owners).must_be :empty? @@ -122,6 +152,12 @@ end it "sets predefined ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) file = nil safe_gcs_execute { file = bucket.create_file local_file, "PredefinedTest.png" } safe_gcs_execute { file.acl.authenticatedRead! } diff --git a/google-cloud-storage/samples/acceptance/files_test.rb b/google-cloud-storage/samples/acceptance/files_test.rb index 55fbf5200c67..1d2539097f3f 100644 --- a/google-cloud-storage/samples/acceptance/files_test.rb +++ b/google-cloud-storage/samples/acceptance/files_test.rb @@ -324,6 +324,12 @@ def mock_cipher.random_key end it "make_public" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.create_file local_file, remote_file_name response = Net::HTTP.get URI(bucket.file(remote_file_name).public_url) refute_equal File.read(local_file), response diff --git a/google-cloud-storage/samples/acceptance/iam_test.rb b/google-cloud-storage/samples/acceptance/iam_test.rb index 3213d0adad41..aad8fa8dd27b 100644 --- a/google-cloud-storage/samples/acceptance/iam_test.rb +++ b/google-cloud-storage/samples/acceptance/iam_test.rb @@ -55,6 +55,12 @@ end it "set_bucket_public_iam" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) # set_bucket_public_iam assert_output "Bucket #{bucket.name} is now publicly readable\n" do set_bucket_public_iam bucket_name: bucket.name From 1733a6b4e0ef7387f1b60c733b8a4afe0caad3e8 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Wed, 4 Feb 2026 08:14:36 +0000 Subject: [PATCH 4/7] skipping tests --- google-cloud-storage/acceptance/storage/bucket_acl_test.rb | 6 ++++++ .../storage/bucket_uniform_bucket_level_access_test.rb | 6 ++++++ google-cloud-storage/acceptance/storage/file_acl_test.rb | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb index becdba889fa9..57a749dd6bb7 100644 --- a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb @@ -74,6 +74,12 @@ end it "deletes rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) bucket.acl.auth! _(bucket.acl.readers).must_include "allAuthenticatedUsers" bucket.acl.delete "allAuthenticatedUsers" diff --git a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb index c091f26f6ccc..9b063fc354d2 100644 --- a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb @@ -181,6 +181,12 @@ end it "sets DEPRECATED policy_only true and is unable to modify bucket ACL rules" do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) refute bucket.policy_only? bucket.policy_only = true assert bucket.policy_only? diff --git a/google-cloud-storage/acceptance/storage/file_acl_test.rb b/google-cloud-storage/acceptance/storage/file_acl_test.rb index a62ce9ca8fb5..f2d6085c97b2 100644 --- a/google-cloud-storage/acceptance/storage/file_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/file_acl_test.rb @@ -45,6 +45,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true file = bucket.create_file local_file, "ReaderTest.png" user_val = "user-test@example.com" _(file.acl.readers).wont_include user_val @@ -63,6 +64,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true file = bucket.create_file local_file, "OwnerTest.png" user_val = "user-test@example.com" _(file.acl.owners).wont_include user_val @@ -81,6 +83,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true file = bucket.create_file local_file, "AclTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.private! @@ -98,6 +101,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true file = bucket.create_file local_file, "DeleteTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.delete "allAuthenticatedUsers" @@ -115,6 +119,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true bucket.default_acl.private! file = bucket.create_file local_file, "CRUDTest.png" _(bucket.default_acl.owners).must_be :empty? @@ -158,6 +163,7 @@ "access prevention is enforced. See " \ "https://cloud.google.com/storage/docs/public-access-prevention for more details." ) + @skip_cleanup = true file = nil safe_gcs_execute { file = bucket.create_file local_file, "PredefinedTest.png" } safe_gcs_execute { file.acl.authenticatedRead! } From 578b871d145173ea12318162cdf5a19a7909cfde Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Thu, 5 Feb 2026 07:10:14 +0000 Subject: [PATCH 5/7] skip --- .../acceptance/storage/file_acl_test.rb | 53 ++++--------------- 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/file_acl_test.rb b/google-cloud-storage/acceptance/storage/file_acl_test.rb index f2d6085c97b2..f6789c7607c9 100644 --- a/google-cloud-storage/acceptance/storage/file_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/file_acl_test.rb @@ -30,6 +30,12 @@ let(:user_val) { "user-test@example.com" } before do + skip( + "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details." + ) # always create the bucket and set default acl to auth safe_gcs_execute { bucket.default_acl.auth! } end @@ -39,13 +45,6 @@ end it "adds a reader" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true file = bucket.create_file local_file, "ReaderTest.png" user_val = "user-test@example.com" _(file.acl.readers).wont_include user_val @@ -58,13 +57,7 @@ end it "adds an owner" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true + file = bucket.create_file local_file, "OwnerTest.png" user_val = "user-test@example.com" _(file.acl.owners).wont_include user_val @@ -77,13 +70,7 @@ end it "updates predefined rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true + file = bucket.create_file local_file, "AclTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.private! @@ -95,13 +82,7 @@ end it "deletes rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true + file = bucket.create_file local_file, "DeleteTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.delete "allAuthenticatedUsers" @@ -113,13 +94,7 @@ end it "retrieves and modifies the ACL" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true + bucket.default_acl.private! file = bucket.create_file local_file, "CRUDTest.png" _(bucket.default_acl.owners).must_be :empty? @@ -157,13 +132,7 @@ end it "sets predefined ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) - @skip_cleanup = true + file = nil safe_gcs_execute { file = bucket.create_file local_file, "PredefinedTest.png" } safe_gcs_execute { file.acl.authenticatedRead! } From 451a0b0d62a5e52ea281244f20be1e6af737eef4 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Thu, 5 Feb 2026 07:13:43 +0000 Subject: [PATCH 6/7] lint fix --- google-cloud-storage/acceptance/storage/file_acl_test.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/file_acl_test.rb b/google-cloud-storage/acceptance/storage/file_acl_test.rb index f6789c7607c9..6c27bfb8b0fa 100644 --- a/google-cloud-storage/acceptance/storage/file_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/file_acl_test.rb @@ -57,7 +57,6 @@ end it "adds an owner" do - file = bucket.create_file local_file, "OwnerTest.png" user_val = "user-test@example.com" _(file.acl.owners).wont_include user_val @@ -70,7 +69,6 @@ end it "updates predefined rules" do - file = bucket.create_file local_file, "AclTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.private! @@ -82,7 +80,6 @@ end it "deletes rules" do - file = bucket.create_file local_file, "DeleteTest.png" _(file.acl.readers).must_include "allAuthenticatedUsers" file.acl.delete "allAuthenticatedUsers" @@ -94,7 +91,6 @@ end it "retrieves and modifies the ACL" do - bucket.default_acl.private! file = bucket.create_file local_file, "CRUDTest.png" _(bucket.default_acl.owners).must_be :empty? @@ -132,7 +128,6 @@ end it "sets predefined ACL rules" do - file = nil safe_gcs_execute { file = bucket.create_file local_file, "PredefinedTest.png" } safe_gcs_execute { file.acl.authenticatedRead! } From 47c41ea37ca12121ffe10f95335b8e689cf39b65 Mon Sep 17 00:00:00 2001 From: Shubhangi Singh Date: Thu, 5 Feb 2026 11:05:47 +0000 Subject: [PATCH 7/7] refactor --- .../acceptance/storage/bucket_acl_test.rb | 21 +------ .../storage/bucket_default_acl_test.rb | 21 +------ ...bucket_uniform_bucket_level_access_test.rb | 56 +++---------------- .../acceptance/storage/file_acl_test.rb | 7 +-- .../acceptance/storage/file_test.rb | 21 +------ .../acceptance/storage_helper.rb | 5 ++ .../samples/acceptance/files_test.rb | 7 +-- .../samples/acceptance/helper.rb | 4 ++ .../samples/acceptance/iam_test.rb | 7 +-- 9 files changed, 29 insertions(+), 120 deletions(-) diff --git a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb index 57a749dd6bb7..51e5fb107037 100644 --- a/google-cloud-storage/acceptance/storage/bucket_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_acl_test.rb @@ -58,12 +58,7 @@ end it "updates predefined rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE _(bucket.acl.readers).wont_include "allAuthenticatedUsers" bucket.acl.auth! _(bucket.acl.readers).must_include "allAuthenticatedUsers" @@ -74,12 +69,7 @@ end it "deletes rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE bucket.acl.auth! _(bucket.acl.readers).must_include "allAuthenticatedUsers" bucket.acl.delete "allAuthenticatedUsers" @@ -129,12 +119,7 @@ end it "sets predefined ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE safe_gcs_execute { bucket.acl.authenticatedRead! } safe_gcs_execute { bucket.acl.auth! } safe_gcs_execute { bucket.acl.auth_read! } diff --git a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb index 4dc33e0d4357..2f87465f8f66 100644 --- a/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb @@ -50,12 +50,7 @@ end it "updates predefined rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE _(bucket.default_acl.readers).wont_include "allAuthenticatedUsers" bucket.default_acl.auth! _(bucket.default_acl.readers).must_include "allAuthenticatedUsers" @@ -66,12 +61,7 @@ end it "deletes rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE bucket.default_acl.auth! _(bucket.default_acl.readers).must_include "allAuthenticatedUsers" bucket.default_acl.delete "allAuthenticatedUsers" @@ -118,12 +108,7 @@ end it "sets predefined ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE safe_gcs_execute { bucket.default_acl.authenticatedRead! } safe_gcs_execute { bucket.default_acl.auth! } safe_gcs_execute { bucket.default_acl.auth_read! } diff --git a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb index 9b063fc354d2..dc9acf5fbc65 100644 --- a/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb +++ b/google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb @@ -75,12 +75,7 @@ end it "sets uniform_bucket_level_access true and is unable to modify bucket ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE refute bucket.uniform_bucket_level_access? bucket.uniform_bucket_level_access = true assert bucket.uniform_bucket_level_access? @@ -90,12 +85,7 @@ end it "sets uniform_bucket_level_access true and is unable to modify default ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE refute bucket.uniform_bucket_level_access? bucket.uniform_bucket_level_access = true assert bucket.uniform_bucket_level_access? @@ -119,12 +109,7 @@ end it "sets uniform_bucket_level_access true and default object acl and object acls are preserved" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE bucket.default_acl.public! _(bucket.default_acl.readers).must_equal ["allUsers"] file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt" @@ -159,12 +144,7 @@ end it "sets DEPRECATED policy_only true and is unable to get the file" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE refute bucket.policy_only? file = bucket.create_file local_file, "ReaderTest.png" @@ -181,12 +161,7 @@ end it "sets DEPRECATED policy_only true and is unable to modify bucket ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE refute bucket.policy_only? bucket.policy_only = true assert bucket.policy_only? @@ -196,12 +171,7 @@ end it "sets DEPRECATED policy_only true and is unable to modify default ACL rules" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE refute bucket.policy_only? safe_gcs_execute { bucket.policy_only = true } assert bucket.policy_only? @@ -225,12 +195,7 @@ end it "sets DEPRECATED policy_only true and default object acl and object acls are preserved" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE bucket.default_acl.public! _(bucket.default_acl.readers).must_equal ["allUsers"] file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt" @@ -251,12 +216,7 @@ end it "creates new bucket with public_access_prevention enforced then sets public_access_prevention to enforced" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE # Insert a new bucket with Public Access Prevention Enforced. bucket_pap = storage.create_bucket "#{$bucket_names[2]}-pap" do |b| b.public_access_prevention = :enforced diff --git a/google-cloud-storage/acceptance/storage/file_acl_test.rb b/google-cloud-storage/acceptance/storage/file_acl_test.rb index 6c27bfb8b0fa..eba246beddfd 100644 --- a/google-cloud-storage/acceptance/storage/file_acl_test.rb +++ b/google-cloud-storage/acceptance/storage/file_acl_test.rb @@ -30,12 +30,7 @@ let(:user_val) { "user-test@example.com" } before do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE # always create the bucket and set default acl to auth safe_gcs_execute { bucket.default_acl.auth! } end diff --git a/google-cloud-storage/acceptance/storage/file_test.rb b/google-cloud-storage/acceptance/storage/file_test.rb index 982acd5f56d0..f6aadc89fcd9 100644 --- a/google-cloud-storage/acceptance/storage/file_test.rb +++ b/google-cloud-storage/acceptance/storage/file_test.rb @@ -595,12 +595,7 @@ end it "should copy an existing file" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" @@ -634,12 +629,7 @@ end it "should copy an existing file, with updates" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" @@ -676,12 +666,7 @@ end it "should copy an existing file, with force_copy_metadata set to true" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png" _(uploaded.acl.readers).must_include "allUsers" # has "public_read" _(uploaded.content_language).must_equal "en" diff --git a/google-cloud-storage/acceptance/storage_helper.rb b/google-cloud-storage/acceptance/storage_helper.rb index 2523282dafe1..3e10cc64ede0 100644 --- a/google-cloud-storage/acceptance/storage_helper.rb +++ b/google-cloud-storage/acceptance/storage_helper.rb @@ -22,6 +22,11 @@ require "google/cloud/storage" require "google/cloud/pubsub" +PAP_SKIP_MESSAGE = "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details.".freeze + # Generate JUnit format test reports if ENV["GCLOUD_TEST_GENERATE_XML_REPORT"] require "minitest/reporters" diff --git a/google-cloud-storage/samples/acceptance/files_test.rb b/google-cloud-storage/samples/acceptance/files_test.rb index 1d2539097f3f..c7858d74d2bc 100644 --- a/google-cloud-storage/samples/acceptance/files_test.rb +++ b/google-cloud-storage/samples/acceptance/files_test.rb @@ -324,12 +324,7 @@ def mock_cipher.random_key end it "make_public" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE bucket.create_file local_file, remote_file_name response = Net::HTTP.get URI(bucket.file(remote_file_name).public_url) refute_equal File.read(local_file), response diff --git a/google-cloud-storage/samples/acceptance/helper.rb b/google-cloud-storage/samples/acceptance/helper.rb index 61a8f288c315..24de67d06a37 100644 --- a/google-cloud-storage/samples/acceptance/helper.rb +++ b/google-cloud-storage/samples/acceptance/helper.rb @@ -24,6 +24,10 @@ require "uri" require "ostruct" +PAP_SKIP_MESSAGE = "Skipping this test due to a change in GCS behavior that disallows copying " \ + "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ + "access prevention is enforced. See " \ + "https://cloud.google.com/storage/docs/public-access-prevention for more details.".freeze def fixture_bucket storage_client = Google::Cloud::Storage.new diff --git a/google-cloud-storage/samples/acceptance/iam_test.rb b/google-cloud-storage/samples/acceptance/iam_test.rb index aad8fa8dd27b..40c0ad7941ed 100644 --- a/google-cloud-storage/samples/acceptance/iam_test.rb +++ b/google-cloud-storage/samples/acceptance/iam_test.rb @@ -55,12 +55,7 @@ end it "set_bucket_public_iam" do - skip( - "Skipping this test due to a change in GCS behavior that disallows copying " \ - "files with ACLs that include allUsers or allAuthenticatedUsers when public " \ - "access prevention is enforced. See " \ - "https://cloud.google.com/storage/docs/public-access-prevention for more details." - ) + skip PAP_SKIP_MESSAGE # set_bucket_public_iam assert_output "Bucket #{bucket.name} is now publicly readable\n" do set_bucket_public_iam bucket_name: bucket.name