Skip to content

Commit 2c77d02

Browse files
chore(storage): Skipping test cases with pap issue (#32426)
* skipping test cases due to error * syntax fix * skip tests * skipping tests * skip * lint fix * refactor
1 parent 7e36eba commit 2c77d02

File tree

9 files changed

+30
-0
lines changed

9 files changed

+30
-0
lines changed

google-cloud-storage/acceptance/storage/bucket_acl_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
end
5959

6060
it "updates predefined rules" do
61+
skip PAP_SKIP_MESSAGE
6162
_(bucket.acl.readers).wont_include "allAuthenticatedUsers"
6263
bucket.acl.auth!
6364
_(bucket.acl.readers).must_include "allAuthenticatedUsers"
@@ -68,6 +69,7 @@
6869
end
6970

7071
it "deletes rules" do
72+
skip PAP_SKIP_MESSAGE
7173
bucket.acl.auth!
7274
_(bucket.acl.readers).must_include "allAuthenticatedUsers"
7375
bucket.acl.delete "allAuthenticatedUsers"
@@ -117,6 +119,7 @@
117119
end
118120

119121
it "sets predefined ACL rules" do
122+
skip PAP_SKIP_MESSAGE
120123
safe_gcs_execute { bucket.acl.authenticatedRead! }
121124
safe_gcs_execute { bucket.acl.auth! }
122125
safe_gcs_execute { bucket.acl.auth_read! }

google-cloud-storage/acceptance/storage/bucket_default_acl_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
end
5151

5252
it "updates predefined rules" do
53+
skip PAP_SKIP_MESSAGE
5354
_(bucket.default_acl.readers).wont_include "allAuthenticatedUsers"
5455
bucket.default_acl.auth!
5556
_(bucket.default_acl.readers).must_include "allAuthenticatedUsers"
@@ -60,6 +61,7 @@
6061
end
6162

6263
it "deletes rules" do
64+
skip PAP_SKIP_MESSAGE
6365
bucket.default_acl.auth!
6466
_(bucket.default_acl.readers).must_include "allAuthenticatedUsers"
6567
bucket.default_acl.delete "allAuthenticatedUsers"
@@ -106,6 +108,7 @@
106108
end
107109

108110
it "sets predefined ACL rules" do
111+
skip PAP_SKIP_MESSAGE
109112
safe_gcs_execute { bucket.default_acl.authenticatedRead! }
110113
safe_gcs_execute { bucket.default_acl.auth! }
111114
safe_gcs_execute { bucket.default_acl.auth_read! }

google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
end
7676

7777
it "sets uniform_bucket_level_access true and is unable to modify bucket ACL rules" do
78+
skip PAP_SKIP_MESSAGE
7879
refute bucket.uniform_bucket_level_access?
7980
bucket.uniform_bucket_level_access = true
8081
assert bucket.uniform_bucket_level_access?
@@ -84,6 +85,7 @@
8485
end
8586

8687
it "sets uniform_bucket_level_access true and is unable to modify default ACL rules" do
88+
skip PAP_SKIP_MESSAGE
8789
refute bucket.uniform_bucket_level_access?
8890
bucket.uniform_bucket_level_access = true
8991
assert bucket.uniform_bucket_level_access?
@@ -107,6 +109,7 @@
107109
end
108110

109111
it "sets uniform_bucket_level_access true and default object acl and object acls are preserved" do
112+
skip PAP_SKIP_MESSAGE
110113
bucket.default_acl.public!
111114
_(bucket.default_acl.readers).must_equal ["allUsers"]
112115
file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt"
@@ -141,6 +144,7 @@
141144
end
142145

143146
it "sets DEPRECATED policy_only true and is unable to get the file" do
147+
skip PAP_SKIP_MESSAGE
144148
refute bucket.policy_only?
145149
file = bucket.create_file local_file, "ReaderTest.png"
146150

@@ -157,6 +161,7 @@
157161
end
158162

159163
it "sets DEPRECATED policy_only true and is unable to modify bucket ACL rules" do
164+
skip PAP_SKIP_MESSAGE
160165
refute bucket.policy_only?
161166
bucket.policy_only = true
162167
assert bucket.policy_only?
@@ -166,6 +171,7 @@
166171
end
167172

168173
it "sets DEPRECATED policy_only true and is unable to modify default ACL rules" do
174+
skip PAP_SKIP_MESSAGE
169175
refute bucket.policy_only?
170176
safe_gcs_execute { bucket.policy_only = true }
171177
assert bucket.policy_only?
@@ -189,6 +195,7 @@
189195
end
190196

191197
it "sets DEPRECATED policy_only true and default object acl and object acls are preserved" do
198+
skip PAP_SKIP_MESSAGE
192199
bucket.default_acl.public!
193200
_(bucket.default_acl.readers).must_equal ["allUsers"]
194201
file_default_acl = bucket.create_file StringIO.new("default_acl"), "default_acl.txt"
@@ -209,6 +216,7 @@
209216
end
210217

211218
it "creates new bucket with public_access_prevention enforced then sets public_access_prevention to enforced" do
219+
skip PAP_SKIP_MESSAGE
212220
# Insert a new bucket with Public Access Prevention Enforced.
213221
bucket_pap = storage.create_bucket "#{$bucket_names[2]}-pap" do |b|
214222
b.public_access_prevention = :enforced

google-cloud-storage/acceptance/storage/file_acl_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
let(:user_val) { "user-test@example.com" }
3131

3232
before do
33+
skip PAP_SKIP_MESSAGE
3334
# always create the bucket and set default acl to auth
3435
safe_gcs_execute { bucket.default_acl.auth! }
3536
end

google-cloud-storage/acceptance/storage/file_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,8 @@
595595
end
596596

597597
it "should copy an existing file" do
598+
skip PAP_SKIP_MESSAGE
599+
598600
uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en"
599601
_(uploaded.acl.readers).must_include "allUsers" # has "public_read"
600602
_(uploaded.content_language).must_equal "en"
@@ -627,6 +629,7 @@
627629
end
628630

629631
it "should copy an existing file, with updates" do
632+
skip PAP_SKIP_MESSAGE
630633
uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png"
631634
_(uploaded.acl.readers).must_include "allUsers" # has "public_read"
632635
_(uploaded.content_language).must_equal "en"
@@ -663,6 +666,7 @@
663666
end
664667

665668
it "should copy an existing file, with force_copy_metadata set to true" do
669+
skip PAP_SKIP_MESSAGE
666670
uploaded = bucket.create_file files[:logo][:path], "CloudLogo", acl: "public_read", content_language: "en", content_type: "image/png"
667671
_(uploaded.acl.readers).must_include "allUsers" # has "public_read"
668672
_(uploaded.content_language).must_equal "en"

google-cloud-storage/acceptance/storage_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
require "google/cloud/storage"
2323
require "google/cloud/pubsub"
2424

25+
PAP_SKIP_MESSAGE = "Skipping this test due to a change in GCS behavior that disallows copying " \
26+
"files with ACLs that include allUsers or allAuthenticatedUsers when public " \
27+
"access prevention is enforced. See " \
28+
"https://cloud.google.com/storage/docs/public-access-prevention for more details.".freeze
29+
2530
# Generate JUnit format test reports
2631
if ENV["GCLOUD_TEST_GENERATE_XML_REPORT"]
2732
require "minitest/reporters"

google-cloud-storage/samples/acceptance/files_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def mock_cipher.random_key
324324
end
325325

326326
it "make_public" do
327+
skip PAP_SKIP_MESSAGE
327328
bucket.create_file local_file, remote_file_name
328329
response = Net::HTTP.get URI(bucket.file(remote_file_name).public_url)
329330
refute_equal File.read(local_file), response

google-cloud-storage/samples/acceptance/helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
require "uri"
2525
require "ostruct"
2626

27+
PAP_SKIP_MESSAGE = "Skipping this test due to a change in GCS behavior that disallows copying " \
28+
"files with ACLs that include allUsers or allAuthenticatedUsers when public " \
29+
"access prevention is enforced. See " \
30+
"https://cloud.google.com/storage/docs/public-access-prevention for more details.".freeze
2731

2832
def fixture_bucket
2933
storage_client = Google::Cloud::Storage.new

google-cloud-storage/samples/acceptance/iam_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
end
5656

5757
it "set_bucket_public_iam" do
58+
skip PAP_SKIP_MESSAGE
5859
# set_bucket_public_iam
5960
assert_output "Bucket #{bucket.name} is now publicly readable\n" do
6061
set_bucket_public_iam bucket_name: bucket.name

0 commit comments

Comments
 (0)