Skip to content

Commit f0822ee

Browse files
authored
feat(monitor-ci/402): get remocal-iox e2es passing (#6443)
* test: temporary commit, points to monitor-ci branch running remocal-iox e2es * fix(monitor-ci/402): handle unescaped URL param for orgID * fix(monitor-ci/402): handle hardcoded limit for 200 unique columns per write * fix(monitor-ci/402): skip tests conditionally on iox, since explicit schemas are not supported on iox * fix(monitor-ci/402): handle Qx Builder different UX for iox, in editor.test * feat(monitor-ci/402): enable running local remocal-iox tests * fix: handle longer page load times (in CI) with tsm&remocal dual storage * chore: remove screening for firefox tests, because we no longer use firefox * feat(monitor-ci/402): temporarily skip tests (on iox only) where there are query failures due to no data being written yet * fix(monitor-ci/402): enable Qx query builder test to run differentially in iox versus non-iox. Match our isIoxOrg different UX. chore: remove use of force click, and instead check for visibility * Revert "test: temporary commit, points to monitor-ci branch running remocal-iox e2es" This reverts commit 994d9c6.
1 parent 4e15913 commit f0822ee

File tree

13 files changed

+356
-175
lines changed

13 files changed

+356
-175
lines changed

cypress/e2e/cloud/buckets.test.ts

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ describe('Explicit Buckets', () => {
101101
})
102102

103103
it('can create a bucket with an explicit schema', () => {
104+
// TODO: iox is not yet supporting explicit schema.
105+
cy.isIoxOrg().then(isIox => {
106+
cy.skipOn(isIox)
107+
})
104108
cy.getByTestID('Create Bucket').click()
105109
cy.getByTestID('overlay--container').within(() => {
106110
cy.getByInputName('name').type('explicit-bucket-test')
@@ -155,15 +159,22 @@ describe('Explicit Buckets', () => {
155159
cy.getByTestID('overlay--container').within(() => {
156160
cy.getByInputName('name').type('implicit-bucket-test')
157161

158-
cy.getByTestID('schemaBucketToggle').click()
159-
160-
// check that it is there; but don't click on it; leave it as implicit:
161-
cy.getByTestID('explicit-bucket-schema-choice-ID').should('be.visible')
162-
163-
// implicit button should be selected by default:
164-
cy.getByTestID('implicit-bucket-schema-choice-ID--input').should(
165-
'be.checked'
166-
)
162+
// TODO: iox is not yet supporting explicit schema.
163+
cy.isIoxOrg().then(isIox => {
164+
if (!isIox) {
165+
cy.getByTestID('schemaBucketToggle').click()
166+
167+
// check that it is there; but don't click on it; leave it as implicit:
168+
cy.getByTestID('explicit-bucket-schema-choice-ID').should(
169+
'be.visible'
170+
)
171+
172+
// implicit button should be selected by default:
173+
cy.getByTestID('implicit-bucket-schema-choice-ID--input').should(
174+
'be.checked'
175+
)
176+
}
177+
})
167178

168179
// measurement schema section should NOT be showing at this time
169180
// (b/c it only shows if explicit is set)
@@ -201,6 +212,10 @@ describe('Explicit Buckets', () => {
201212
})
202213

203214
it('should be able to create an explicit bucket using one schema file', function () {
215+
// TODO: iox is not yet supporting explicit schema.
216+
cy.isIoxOrg().then(isIox => {
217+
cy.skipOn(isIox)
218+
})
204219
const schemaName = 'only one schema'
205220
const filename = 'validSchema1.json'
206221

@@ -254,6 +269,10 @@ describe('Explicit Buckets', () => {
254269
})
255270

256271
it('should be able to create an explicit bucket and add json schema file during editing', function () {
272+
// TODO: iox is not yet supporting explicit schema.
273+
cy.isIoxOrg().then(isIox => {
274+
cy.skipOn(isIox)
275+
})
257276
const origFileContents = `[{"name":"time","type":"timestamp"},
258277
{"name":"fsWrite","type":"field","dataType":"float"} ]`
259278

@@ -282,6 +301,10 @@ describe('Explicit Buckets', () => {
282301
})
283302

284303
it('should be able to create an explicit bucket and add csv schema file during editing', function () {
304+
// TODO: iox is not yet supporting explicit schema.
305+
cy.isIoxOrg().then(isIox => {
306+
cy.skipOn(isIox)
307+
})
285308
const origFileContents = `name,type,dataType
286309
time,timestamp,
287310
host,tag,
@@ -305,6 +328,10 @@ fsRead,field,float`
305328
})
306329

307330
it('should be able to create an explicit bucket and update the existing schema file during editing', function () {
331+
// TODO: iox is not yet supporting explicit schema.
332+
cy.isIoxOrg().then(isIox => {
333+
cy.skipOn(isIox)
334+
})
308335
cy.getByTestID('Create Bucket').click()
309336
cy.getByTestID('create-bucket-form').should('be.visible')
310337
cy.getByTestID('bucket-form-name').type(bucketName)

cypress/e2e/shared/checks.test.ts

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,25 @@ describe('Checks', () => {
226226
})
227227

228228
it('can create and filter checks', () => {
229-
cy.get<Organization>('@org').then((org: Organization) => {
230-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
231-
if (req.body.query.includes('_measurement')) {
232-
req.alias = 'measurementQuery'
229+
cy.get<Organization>('@org').then(({id: orgID}: Organization) => {
230+
cy.intercept(
231+
'POST',
232+
`/api/v2/query?${new URLSearchParams({orgID})}`,
233+
req => {
234+
if (req.body.query.includes('_measurement')) {
235+
req.alias = 'measurementQuery'
236+
}
233237
}
234-
})
235-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
236-
if (req.body.query.includes('distinct(column: "_field")')) {
237-
req.alias = 'fieldQuery'
238+
)
239+
cy.intercept(
240+
'POST',
241+
`/api/v2/query?${new URLSearchParams({orgID})}`,
242+
req => {
243+
if (req.body.query.includes('distinct(column: "_field")')) {
244+
req.alias = 'fieldQuery'
245+
}
238246
}
239-
})
247+
)
240248
cy.get<string>('@defaultBucketListSelector').then(
241249
(defaultBucketListSelector: string) => {
242250
cy.log('create first check')
@@ -265,16 +273,24 @@ describe('Checks', () => {
265273
cy.getByTestID('overlay').should('not.exist')
266274

267275
// create a second check
268-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
269-
if (req.body.query.includes('distinct(column: "_field")')) {
270-
req.alias = 'fieldQueryBeta'
276+
cy.intercept(
277+
'POST',
278+
`/api/v2/query?${new URLSearchParams({orgID})}`,
279+
req => {
280+
if (req.body.query.includes('distinct(column: "_field")')) {
281+
req.alias = 'fieldQueryBeta'
282+
}
271283
}
272-
})
273-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
274-
if (req.body.query.includes('_measurement')) {
275-
req.alias = 'measurementQueryBeta'
284+
)
285+
cy.intercept(
286+
'POST',
287+
`/api/v2/query?${new URLSearchParams({orgID})}`,
288+
req => {
289+
if (req.body.query.includes('_measurement')) {
290+
req.alias = 'measurementQueryBeta'
291+
}
276292
}
277-
})
293+
)
278294
// bust the /query cache
279295
cy.reload()
280296

@@ -405,6 +421,13 @@ describe('Checks', () => {
405421
})
406422

407423
it('deadman checks should render a table for non-numeric fields', () => {
424+
cy.isIoxOrg().then(isIox => {
425+
// iox uses `${orgId}_${bucketId}` for a namespace_id
426+
// And gives a namespace_id failure if no data is written yet.
427+
// https://github.com/influxdata/monitor-ci/issues/402#issuecomment-1362368473
428+
cy.skipOn(isIox)
429+
})
430+
408431
cy.intercept('POST', '/api/v2/query?*', req => {
409432
if (req.body.query.includes('_measurement')) {
410433
req.alias = 'measurementQuery'
@@ -573,6 +596,13 @@ describe('Checks', () => {
573596
})
574597

575598
it('ensures the history page has a graph after check creation confirmation', () => {
599+
cy.isIoxOrg().then(isIox => {
600+
// iox uses `${orgId}_${bucketId}` for a namespace_id
601+
// And gives a namespace_id failure if no data is written yet.
602+
// https://github.com/influxdata/monitor-ci/issues/402#issuecomment-1362368473
603+
cy.skipOn(isIox)
604+
})
605+
576606
cy.getByTestID('context-menu-task').click()
577607
cy.getByTestID('context-history-task').click()
578608
cy.getByTestID('giraffe-axes').should('be.visible')

cypress/e2e/shared/dashboardsRefresh.test.ts

Lines changed: 82 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,14 @@ describe('Dashboard refresh', () => {
7373
})
7474

7575
it('can enable the auto refresh process, then manually stop the process via the dropdown', done => {
76-
cy.get<Organization>('@org').then((org: Organization) => {
77-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
78-
req.alias = 'refreshQuery'
79-
})
76+
cy.get<Organization>('@org').then(({id: orgID}: Organization) => {
77+
cy.intercept(
78+
'POST',
79+
`/api/v2/query?${new URLSearchParams({orgID})}`,
80+
req => {
81+
req.alias = 'refreshQuery'
82+
}
83+
)
8084
cy.getByTestID('enable-auto-refresh-button').click()
8185
cy.getByTestID('auto-refresh-input').clear().type('2s', {force: true})
8286
cy.getByTestID('refresh-form-activate-button').click({force: true})
@@ -94,7 +98,7 @@ describe('Dashboard refresh', () => {
9498
})
9599

96100
it('can timeout on a preset timeout selected by the user', done => {
97-
cy.get<Organization>('@org').then((org: Organization) => {
101+
cy.get<Organization>('@org').then(({id: orgID}: Organization) => {
98102
cy.getByTestID('enable-auto-refresh-button').click()
99103
cy.getByTestID('auto-refresh-input')
100104
.clear()
@@ -109,9 +113,13 @@ describe('Dashboard refresh', () => {
109113
})
110114
cy.getByTestID('refresh-form-activate-button').click()
111115

112-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
113-
req.alias = 'refreshQuery'
114-
})
116+
cy.intercept(
117+
'POST',
118+
`/api/v2/query?${new URLSearchParams({orgID})}`,
119+
req => {
120+
req.alias = 'refreshQuery'
121+
}
122+
)
115123

116124
cy.wait('@refreshQuery')
117125
cy.wait('@refreshQuery')
@@ -125,7 +133,7 @@ describe('Dashboard refresh', () => {
125133
})
126134

127135
it('does not refresh if user edits cell, until user comes back, and then continues', () => {
128-
cy.get<Organization>('@org').then((org: Organization) => {
136+
cy.get<Organization>('@org').then(({id: orgID}: Organization) => {
129137
cy.getByTestID('enable-auto-refresh-button').click()
130138
cy.getByTestID('auto-refresh-input')
131139
.clear()
@@ -138,9 +146,13 @@ describe('Dashboard refresh', () => {
138146
.type(`${jumpAheadTime('00:00:10')}`, {force: true})
139147
cy.getByTestID('daterange--apply-btn').click()
140148
})
141-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
142-
req.alias = 'refreshQuery'
143-
})
149+
cy.intercept(
150+
'POST',
151+
`/api/v2/query?${new URLSearchParams({orgID})}`,
152+
req => {
153+
req.alias = 'refreshQuery'
154+
}
155+
)
144156

145157
cy.getByTestID('refresh-form-activate-button').click()
146158

@@ -163,7 +175,7 @@ describe('Dashboard refresh', () => {
163175
})
164176
})
165177
it('can timeout on a preset inactivity timeout', done => {
166-
cy.get<Organization>('@org').then((org: Organization) => {
178+
cy.get<Organization>('@org').then(({id: orgID}: Organization) => {
167179
cy.getByTestID('enable-auto-refresh-button').contains(
168180
'SET AUTO REFRESH',
169181
{matchCase: false}
@@ -181,9 +193,13 @@ describe('Dashboard refresh', () => {
181193
.type(`${jumpAheadTime('00:00:08')}`, {force: true})
182194
cy.getByTestID('daterange--apply-btn').click()
183195
})
184-
cy.intercept('POST', `/api/v2/query?orgID=${org.id}`, req => {
185-
req.alias = 'refreshQuery'
186-
})
196+
cy.intercept(
197+
'POST',
198+
`/api/v2/query?${new URLSearchParams({orgID})}`,
199+
req => {
200+
req.alias = 'refreshQuery'
201+
}
202+
)
187203

188204
cy.getByTestID('refresh-form-activate-button').click()
189205

@@ -270,16 +286,24 @@ describe('Dashboard refresh', () => {
270286
cy.getByTestID('flux-editor').monacoType(query2)
271287
cy.getByTestID('save-cell--button').click()
272288

273-
cy.intercept('POST', `/api/v2/query?orgID=${orgID}`, req => {
274-
if (req.body.query === query1) {
275-
req.alias = 'firstCellQuery'
289+
cy.intercept(
290+
'POST',
291+
`/api/v2/query?${new URLSearchParams({orgID})}`,
292+
req => {
293+
if (req.body.query === query1) {
294+
req.alias = 'firstCellQuery'
295+
}
276296
}
277-
})
278-
cy.intercept('POST', `/api/v2/query?orgID=${orgID}`, req => {
279-
if (req.body.query === query2) {
280-
req.alias = 'secondCellQuery'
297+
)
298+
cy.intercept(
299+
'POST',
300+
`/api/v2/query?${new URLSearchParams({orgID})}`,
301+
req => {
302+
if (req.body.query === query2) {
303+
req.alias = 'secondCellQuery'
304+
}
281305
}
282-
})
306+
)
283307
cy.getByTestID('cell blah').within(() => {
284308
cy.getByTestID('giraffe-inner-plot')
285309
cy.getByTestID('cell-context--toggle').last().click()
@@ -353,15 +377,19 @@ describe('Dashboard refresh', () => {
353377
cy.getByTestID('flux-editor').monacoType(query2)
354378
cy.getByTestID('save-cell--button').click()
355379

356-
cy.intercept('POST', `/api/v2/query?orgID=${orgID}`, req => {
357-
if (req.body.query === query1) {
358-
// This will only fire when the first cell is unpaused AND it then gets refreshed as part of auto refresh loop, indicating successful operation
359-
done()
360-
}
361-
if (req.body.query === query2) {
362-
req.alias = 'secondCellQuery'
380+
cy.intercept(
381+
'POST',
382+
`/api/v2/query?${new URLSearchParams({orgID})}`,
383+
req => {
384+
if (req.body.query === query1) {
385+
// This will only fire when the first cell is unpaused AND it then gets refreshed as part of auto refresh loop, indicating successful operation
386+
done()
387+
}
388+
if (req.body.query === query2) {
389+
req.alias = 'secondCellQuery'
390+
}
363391
}
364-
})
392+
)
365393
cy.getByTestID('cell blah').within(() => {
366394
cy.getByTestID('giraffe-inner-plot')
367395
cy.getByTestID('cell-context--toggle').last().click()
@@ -441,14 +469,18 @@ describe('Dashboard refresh', () => {
441469
cy.getByTestID('giraffe-inner-plot')
442470
})
443471

444-
cy.intercept('POST', `/api/v2/query?orgID=${orgID}`, req => {
445-
if (req.body.query === query1) {
446-
req.alias = 'refreshCellQuery'
447-
}
448-
if (req.body.query === query2) {
449-
throw new Error('Refreshed the wrong cell')
472+
cy.intercept(
473+
'POST',
474+
`/api/v2/query?${new URLSearchParams({orgID})}`,
475+
req => {
476+
if (req.body.query === query1) {
477+
req.alias = 'refreshCellQuery'
478+
}
479+
if (req.body.query === query2) {
480+
throw new Error('Refreshed the wrong cell')
481+
}
450482
}
451-
})
483+
)
452484
cy.getByTestID('cell blah').within(() => {
453485
cy.getByTestID('giraffe-inner-plot')
454486
cy.getByTestID('cell-context--toggle').last().click()
@@ -516,14 +548,18 @@ describe('Dashboard refresh', () => {
516548
cy.getByTestID('giraffe-inner-plot')
517549
})
518550

519-
cy.intercept('POST', `/api/v2/query?orgID=${orgID}`, req => {
520-
if (req.body.query === query1) {
521-
req.alias = 'refreshCellQuery'
551+
cy.intercept(
552+
'POST',
553+
`/api/v2/query?${new URLSearchParams({orgID})}`,
554+
req => {
555+
if (req.body.query === query1) {
556+
req.alias = 'refreshCellQuery'
557+
}
558+
if (req.body.query === query2) {
559+
req.alias = 'refreshSecondQuery'
560+
}
522561
}
523-
if (req.body.query === query2) {
524-
req.alias = 'refreshSecondQuery'
525-
}
526-
})
562+
)
527563

528564
cy.getByTestID('autorefresh-dropdown-refresh').click()
529565
cy.wait('@refreshCellQuery')

0 commit comments

Comments
 (0)