Skip to content

Commit f3639f9

Browse files
test [M3-9926]: fix for misc test failures (#12198)
* try to fix broken devcloud tests * fix file upload * fix multipleRegions tag * remove test skip * remove multipleRegions filter on test * Added changeset: Fix for misc test failures
1 parent 8cc7333 commit f3639f9

File tree

6 files changed

+39
-32
lines changed

6 files changed

+39
-32
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Fix for misc test failures ([#12198](https://github.com/linode/manager/pull/12198))

packages/manager/cypress/e2e/core/firewalls/migrate-linode-with-firewall.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ describe('Migrate Linode With Firewall', () => {
128128
'be.visible'
129129
);
130130
ui.regionSelect.find().click();
131-
ui.regionSelect.findItemByRegionLabel(mockSingapore.label).click();
131+
ui.regionSelect
132+
.findItemByRegionLabel(mockSingapore.label, mockRegions)
133+
.click();
132134

133135
ui.button
134136
.findByTitle('Enter Migration Queue')
@@ -143,9 +145,8 @@ describe('Migrate Linode With Firewall', () => {
143145
/*
144146
* - Uses real API data to create a Firewall, attach a Linode to it, then migrate the Linode.
145147
*/
146-
it.skip('migrates linode with firewall - real data', () => {
148+
it('migrates linode with firewall - real data', () => {
147149
cy.tag('method:e2e', 'purpose:dcTesting', 'env:multipleRegions');
148-
149150
// Execute the body of the test inside Cypress's command queue to ensure
150151
// that logic that requires multiple regions only executes after tags are evaluated.
151152
cy.defer(async () => {}).then(() => {

packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,24 +172,26 @@ describe('create NodeBalancer', () => {
172172
*/
173173
it('shows DC-specific pricing information when creating a NodeBalancer', () => {
174174
// test fails in environments w/ only one region
175-
cy.addTag('env:multipleRegions');
176-
const initialRegion = getRegionById('us-west');
177-
const linodePayload = {
178-
// NodeBalancers require Linodes with private IPs.
179-
private_ip: true,
180-
region: initialRegion.id,
181-
};
182-
cy.defer(() => createTestLinode(linodePayload)).then((linode) => {
183-
const nodeBal = nodeBalancerFactory.build({
184-
ipv4: linode.ipv4[1],
185-
label: randomLabel(),
175+
cy.tag('env:multipleRegions');
176+
cy.defer(async () => {}).then(() => {
177+
const initialRegion = getRegionById('us-west');
178+
const linodePayload = {
179+
// NodeBalancers require Linodes with private IPs.
180+
private_ip: true,
186181
region: initialRegion.id,
182+
};
183+
cy.defer(() => createTestLinode(linodePayload)).then((linode) => {
184+
const nodeBal = nodeBalancerFactory.build({
185+
ipv4: linode.ipv4[1],
186+
label: randomLabel(),
187+
region: initialRegion.id,
188+
});
189+
190+
// catch request
191+
interceptCreateNodeBalancer().as('createNodeBalancer');
192+
193+
createNodeBalancerWithUI(nodeBal, true);
187194
});
188-
189-
// catch request
190-
interceptCreateNodeBalancer().as('createNodeBalancer');
191-
192-
createNodeBalancerWithUI(nodeBal, true);
193195
});
194196
});
195197
});

packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from 'support/intercepts/object-storage';
1313
import { ui } from 'support/ui';
1414
import { cleanUp } from 'support/util/cleanup';
15+
import { chooseCluster } from 'support/util/clusters';
1516
import { randomLabel } from 'support/util/random';
1617

1718
import { accountFactory } from 'src/factories';
@@ -120,9 +121,9 @@ describe('object storage access key end-to-end tests', () => {
120121
*/
121122
it('can create an access key with limited access - e2e', () => {
122123
const bucketLabel = randomLabel();
123-
const bucketCluster = 'us-east-1';
124+
const bucketClusterObj = chooseCluster();
124125
const bucketRequest = createObjectStorageBucketFactoryLegacy.build({
125-
cluster: bucketCluster,
126+
cluster: bucketClusterObj.id,
126127
label: bucketLabel,
127128
// Default factory sets `cluster` and `region`, but API does not accept `region` yet.
128129
region: undefined,
@@ -208,7 +209,7 @@ describe('object storage access key end-to-end tests', () => {
208209
});
209210
});
210211

211-
const permissionLabel = `This token has read-only access for ${bucketCluster}-${bucketLabel}`;
212+
const permissionLabel = `This token has read-only access for ${bucketClusterObj.id}-${bucketLabel}`;
212213
cy.findByLabelText(permissionLabel).should('be.visible');
213214
});
214215
});

packages/manager/cypress/e2e/core/objectStorageMulticluster/object-storage-objects-multicluster.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
55
import { interceptUploadBucketObjectS3 } from 'support/intercepts/object-storage';
66
import { ui } from 'support/ui';
77
import { cleanUp } from 'support/util/cleanup';
8+
import { chooseCluster } from 'support/util/clusters';
89
import { randomLabel } from 'support/util/random';
910

1011
import { createObjectStorageBucketFactoryGen1 } from 'src/factories';
@@ -131,8 +132,8 @@ describe('Object Storage Multicluster objects', () => {
131132
*/
132133
it('can upload, access, and delete objects', () => {
133134
const bucketLabel = randomLabel();
134-
const bucketCluster = 'us-southeast-1';
135-
const bucketRegionId = 'us-southeast';
135+
const bucketClusterObj = chooseCluster();
136+
const bucketRegionId = bucketClusterObj.region;
136137
const bucketPage = `/object-storage/buckets/${bucketRegionId}/${bucketLabel}/objects`;
137138
const bucketFolderName = randomLabel();
138139

@@ -147,7 +148,7 @@ describe('Object Storage Multicluster objects', () => {
147148
).then(() => {
148149
interceptUploadBucketObjectS3(
149150
bucketLabel,
150-
bucketCluster,
151+
bucketClusterObj.domain,
151152
bucketFiles[0].name
152153
).as('uploadObject');
153154

@@ -200,7 +201,7 @@ describe('Object Storage Multicluster objects', () => {
200201
cy.findByText(emptyFolderMessage).should('be.visible');
201202
interceptUploadBucketObjectS3(
202203
bucketLabel,
203-
bucketCluster,
204+
bucketClusterObj.domain,
204205
`${bucketFolderName}/${bucketFiles[1].name}`
205206
).as('uploadObject');
206207
uploadFile(bucketFiles[1].path, bucketFiles[1].name);

packages/manager/cypress/support/intercepts/object-storage.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,17 @@ export const mockUploadBucketObject = (
296296
* Intercepts S3 PUT request to upload bucket object.
297297
*
298298
* @param label - Object storage bucket label.
299-
* @param cluster - Object storage bucket cluster.
299+
* @param domain - Object storage bucket cluster.
300300
* @param filename - Object filename.
301301
*
302302
* @returns Cypress chainable.
303303
*/
304304
export const interceptUploadBucketObjectS3 = (
305305
label: string,
306-
cluster: string,
306+
domain: string,
307307
filename: string
308308
): Cypress.Chainable<null> => {
309-
return cy.intercept(
310-
'PUT',
311-
`https://${cluster}.linodeobjects.com/${label}/${filename}*`
312-
);
309+
return cy.intercept('PUT', `https://${domain}/${label}/${filename}*`);
313310
};
314311

315312
/**

0 commit comments

Comments
 (0)