From 939d4294a88dfa2fbef8f75cf24b7190ef846269 Mon Sep 17 00:00:00 2001 From: Connie Liu Date: Wed, 30 Oct 2024 15:48:18 -0400 Subject: [PATCH 1/3] update existing obj cypress tests to mock obj gen 2 flags as disabled --- .../e2e/core/objectStorage/access-key.e2e.spec.ts | 3 ++- .../e2e/core/objectStorage/access-keys.smoke.spec.ts | 9 ++++++--- .../core/objectStorage/enable-object-storage.spec.ts | 3 ++- .../core/objectStorage/object-storage.e2e.spec.ts | 3 ++- .../core/objectStorage/object-storage.smoke.spec.ts | 12 ++++++++---- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts index 17fda30faa9..cb670ce1cf2 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts @@ -38,9 +38,10 @@ describe('object storage access key end-to-end tests', () => { interceptGetAccessKeys().as('getKeys'); interceptCreateAccessKey().as('createKey'); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); cy.visitWithLogin('/object-storage/access-keys'); diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts index 3182a4c5bed..8109717608d 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-keys.smoke.spec.ts @@ -42,9 +42,10 @@ describe('object storage access keys smoke tests', () => { secret_key: randomString(39), }); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); mockGetAccessKeys([]).as('getKeys'); @@ -113,9 +114,10 @@ describe('object storage access keys smoke tests', () => { secret_key: randomString(39), }); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); // Mock initial GET request to include an access key. @@ -162,11 +164,12 @@ describe('object storage access keys smoke tests', () => { beforeEach(() => { mockGetAccount( accountFactory.build({ - capabilities: ['Object Storage Access Key Regions'], + capabilities: ['Object Storage', 'Object Storage Access Key Regions'], }) ); mockAppendFeatureFlags({ objMultiCluster: true, + objectStorageGen2: { enabled: false }, }); }); diff --git a/packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts index 5073da56424..7772498eabc 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts @@ -56,9 +56,10 @@ describe('Object Storage enrollment', () => { * - Confirms that consistent pricing information is shown for all regions in the enable modal. */ it('can enroll in Object Storage', () => { - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); const mockAccountSettings = accountSettingsFactory.build({ diff --git a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts index 8599f4a1621..f9c431f5a30 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts @@ -183,9 +183,10 @@ describe('object storage end-to-end tests', () => { interceptDeleteBucket(bucketLabel, bucketCluster).as('deleteBucket'); interceptGetNetworkUtilization().as('getNetworkUtilization'); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }).as('getFeatureFlags'); cy.visitWithLogin('/object-storage'); diff --git a/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts index e189ad3a87d..ec96b743c0b 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts @@ -60,11 +60,12 @@ describe('object storage smoke tests', () => { mockGetAccount( accountFactory.build({ - capabilities: ['Object Storage Access Key Regions'], + capabilities: ['Object Storage', 'Object Storage Access Key Regions'], }) ); mockAppendFeatureFlags({ objMultiCluster: true, + objectStorageGen2: { enabled: false }, }).as('getFeatureFlags'); mockGetRegions(mockRegions).as('getRegions'); @@ -160,9 +161,10 @@ describe('object storage smoke tests', () => { hostname: bucketHostname, }); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, gecko2: false, }).as('getFeatureFlags'); @@ -297,9 +299,10 @@ describe('object storage smoke tests', () => { objects: 0, }); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] })); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); mockGetBuckets([bucketMock]).as('getBuckets'); @@ -348,11 +351,12 @@ describe('object storage smoke tests', () => { mockGetAccount( accountFactory.build({ - capabilities: ['Object Storage Access Key Regions'], + capabilities: ['Object Storage', 'Object Storage Access Key Regions'], }) ); mockAppendFeatureFlags({ objMultiCluster: true, + objectStorageGen2: { enabled: false }, }); mockGetBuckets([bucketMock]).as('getBuckets'); From 722b68460eb50afd79e5c534a731c176ae63aef6 Mon Sep 17 00:00:00 2001 From: Connie Liu Date: Wed, 30 Oct 2024 15:53:50 -0400 Subject: [PATCH 2/3] update access-key spec --- .../cypress/e2e/core/objectStorage/access-key.e2e.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts index cb670ce1cf2..07ca420e56d 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts @@ -133,9 +133,12 @@ describe('object storage access key end-to-end tests', () => { ).then(() => { const keyLabel = randomLabel(); - mockGetAccount(accountFactory.build({ capabilities: [] })); + mockGetAccount( + accountFactory.build({ capabilities: ['Object Storage'] }) + ); mockAppendFeatureFlags({ objMultiCluster: false, + objectStorageGen2: { enabled: false }, }); interceptGetAccessKeys().as('getKeys'); From ae7d2d30eb088e8443463a083c38c7a019f4959a Mon Sep 17 00:00:00 2001 From: Connie Liu Date: Thu, 31 Oct 2024 15:37:26 -0400 Subject: [PATCH 3/3] Added changeset: Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests --- packages/manager/.changeset/pr-11191-tests-1730403446066.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-11191-tests-1730403446066.md diff --git a/packages/manager/.changeset/pr-11191-tests-1730403446066.md b/packages/manager/.changeset/pr-11191-tests-1730403446066.md new file mode 100644 index 00000000000..61d61de165b --- /dev/null +++ b/packages/manager/.changeset/pr-11191-tests-1730403446066.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Mock disable OBJ Gen 2 flags for existing OBJ Cypress tests ([#11191](https://github.com/linode/manager/pull/11191))