Skip to content

Commit 4e3c328

Browse files
authored
test: skip system tests requiring public access (googleapis#2717)
Skips tests that attempt to assign public or authenticated user roles to IAM policies. These tests are currently failing with 403 errors due to environment permission restrictions.
1 parent 3052265 commit 4e3c328

3 files changed

Lines changed: 66 additions & 11 deletions

File tree

samples/system-test/buckets.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,12 @@ it("should add a bucket's website configuration", async () => {
366366
});
367367
});
368368

369-
it('should make bucket publicly readable', async () => {
369+
/**
370+
* TODO: Re-enable once the test environment allows public IAM roles.
371+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
372+
* 'allAuthenticatedUsers' permissions.
373+
*/
374+
it.skip('should make bucket publicly readable', async () => {
370375
const output = execSync(`node makeBucketPublic.js ${bucketName}`);
371376
assert.match(
372377
output,

samples/system-test/files.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,12 @@ describe('file', () => {
334334
await bucket.file(publicFileName).delete();
335335
});
336336

337-
it('should make a file public', () => {
337+
/**
338+
* TODO: Re-enable once the test environment allows public IAM roles.
339+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
340+
* 'allAuthenticatedUsers' permissions.
341+
*/
342+
it.skip('should make a file public', () => {
338343
const output = execSync(
339344
`node makePublic.js ${bucketName} ${publicFileName}`
340345
);

system-test/storage.ts

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ describe('storage', function () {
289289
await bucket.acl.delete({entity: USER_ACCOUNT});
290290
});
291291

292-
it('should make a bucket public', async () => {
292+
/**
293+
* TODO: Re-enable once the test environment allows public IAM roles.
294+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
295+
* 'allAuthenticatedUsers' permissions.
296+
*/
297+
it.skip('should make a bucket public', async () => {
293298
await bucket.makePublic();
294299
const [aclObject] = await bucket.acl.get({entity: 'allUsers'});
295300
assert.deepStrictEqual(aclObject, {
@@ -302,7 +307,12 @@ describe('storage', function () {
302307
await bucket.acl.delete({entity: 'allUsers'});
303308
});
304309

305-
it('should make files public', async () => {
310+
/**
311+
* TODO: Re-enable once the test environment allows public IAM roles.
312+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
313+
* 'allAuthenticatedUsers' permissions.
314+
*/
315+
it.skip('should make files public', async () => {
306316
await Promise.all(
307317
['a', 'b', 'c'].map(text => createFileWithContentPromise(text))
308318
);
@@ -319,7 +329,12 @@ describe('storage', function () {
319329
]);
320330
});
321331

322-
it('should make a bucket private', async () => {
332+
/**
333+
* TODO: Re-enable once the test environment allows public IAM roles.
334+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
335+
* 'allAuthenticatedUsers' permissions.
336+
*/
337+
it.skip('should make a bucket private', async () => {
323338
try {
324339
await bucket.makePublic();
325340
await new Promise(resolve =>
@@ -404,7 +419,12 @@ describe('storage', function () {
404419
await file.acl.delete({entity: USER_ACCOUNT});
405420
});
406421

407-
it('should make a file public', async () => {
422+
/**
423+
* TODO: Re-enable once the test environment allows public IAM roles.
424+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
425+
* 'allAuthenticatedUsers' permissions.
426+
*/
427+
it.skip('should make a file public', async () => {
408428
await file.makePublic();
409429
const [aclObject] = await file.acl.get({entity: 'allUsers'});
410430
assert.deepStrictEqual(aclObject, {
@@ -452,7 +472,12 @@ describe('storage', function () {
452472
assert.strictEqual(encryptionAlgorithm, 'AES256');
453473
});
454474

455-
it('should make a file public during the upload', async () => {
475+
/**
476+
* TODO: Re-enable once the test environment allows public IAM roles.
477+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
478+
* 'allAuthenticatedUsers' permissions.
479+
*/
480+
it.skip('should make a file public during the upload', async () => {
456481
const [file] = await bucket.upload(FILES.big.path, {
457482
resumable: false,
458483
public: true,
@@ -465,7 +490,12 @@ describe('storage', function () {
465490
});
466491
});
467492

468-
it('should make a file public from a resumable upload', async () => {
493+
/**
494+
* TODO: Re-enable once the test environment allows public IAM roles.
495+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
496+
* 'allAuthenticatedUsers' permissions.
497+
*/
498+
it.skip('should make a file public from a resumable upload', async () => {
469499
const [file] = await bucket.upload(FILES.big.path, {
470500
resumable: true,
471501
public: true,
@@ -529,7 +559,12 @@ describe('storage', function () {
529559
]);
530560
});
531561

532-
it('should set a policy', async () => {
562+
/**
563+
* TODO: Re-enable once the test environment allows public IAM roles.
564+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
565+
* 'allAuthenticatedUsers' permissions.
566+
*/
567+
it.skip('should set a policy', async () => {
533568
const [policy] = await bucket.iam.getPolicy();
534569
policy!.bindings.push({
535570
role: 'roles/storage.legacyBucketReader',
@@ -2305,7 +2340,12 @@ describe('storage', function () {
23052340
});
23062341
});
23072342

2308-
it('iam#setPolicy', async () => {
2343+
/**
2344+
* TODO: Re-enable once the test environment allows public IAM roles.
2345+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
2346+
* 'allAuthenticatedUsers' permissions.
2347+
*/
2348+
it.skip('iam#setPolicy', async () => {
23092349
await requesterPaysDoubleTest(async options => {
23102350
const [policy] = await bucket.iam.getPolicy();
23112351

@@ -3004,7 +3044,12 @@ describe('storage', function () {
30043044
await Promise.all([file.delete, copiedFile.delete()]);
30053045
});
30063046

3007-
it('should respect predefined Acl at file#copy', async () => {
3047+
/**
3048+
* TODO: Re-enable once the test environment allows public IAM roles.
3049+
* Currently disabled to avoid 403 errors when adding 'allUsers' or
3050+
* 'allAuthenticatedUsers' permissions.
3051+
*/
3052+
it.skip('should respect predefined Acl at file#copy', async () => {
30083053
const opts = {destination: 'CloudLogo'};
30093054
const [file] = await bucket.upload(FILES.logo.path, opts);
30103055
const copyOpts = {predefinedAcl: 'publicRead'};

0 commit comments

Comments
 (0)