Skip to content

Commit 18f65a7

Browse files
authored
fix: hardcoded comparison timestamp, prevents CI from running flows tests. (#6550)
* test: can CI pipeline pass * fix: allow CI to access notebooks, bypassing hardcoded timestamp. * fix: add flag to flows test
1 parent 30fd636 commit 18f65a7

File tree

9 files changed

+33
-16
lines changed

9 files changed

+33
-16
lines changed

cypress/e2e/cloud/flows.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ describe('Flows', () => {
88
cy.fixture('routes').then(({orgs}) => {
99
cy.visit(`${orgs}/${id}`)
1010
cy.getByTestID('version-info').should('be.visible')
11-
1211
cy.createNotebook(id).then(() => {
1312
cy.reload()
1413
})
15-
16-
cy.getByTestID('nav-item-flows').should('be.visible')
17-
cy.getByTestID('nav-item-flows').click()
14+
cy.setFeatureFlags({
15+
showNotebooksForCI: true,
16+
}).then(() => {
17+
cy.getByTestID('nav-item-flows').should('be.visible')
18+
cy.getByTestID('nav-item-flows').click()
19+
})
1820
})
1921
})
2022
})
@@ -262,6 +264,7 @@ describe('Flows with newQueryBuilder flag on', () => {
262264
cy.fixture('routes').then(({orgs}) => {
263265
cy.setFeatureFlags({
264266
newQueryBuilder: true,
267+
showNotebooksForCI: true,
265268
}).then(() => {
266269
cy.visit(`${orgs}/${id}`)
267270
})

cypress/e2e/shared/editor.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ describe('Editor+LSP communication', () => {
4949
before(() => {
5050
cy.flush()
5151
cy.signin()
52-
cy.setFeatureFlags({schemaComposition: true})
52+
cy.setFeatureFlags({schemaComposition: true, showNotebooksForCI: true})
5353
cy.get('@org').then(({id}: Organization) =>
5454
cy.fixture('routes').then(({orgs}) => {
5555
cy.visit(`${orgs}/${id}`)
56-
5756
cy.createNotebook(id).then(() => {
5857
cy.reload()
5958
})

cypress/e2e/shared/flows.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe('Flows', () => {
1515
// Double check that the new schemaComposition flag does not interfere.
1616
cy.setFeatureFlags({
1717
schemaComposition: true,
18+
showNotebooksForCI: true,
1819
})
1920
// cy.wait($time) is necessary to consistently ensure sufficient time for the feature flag override.
2021
// The flag reset happens via redux, (it's not a network request), so we can't cy.wait($intercepted_route).

cypress/e2e/shared/flowsAlerts.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('flows alert panel', () => {
2727
.setFeatureFlags({
2828
notebooksExp: true,
2929
notebooksNewEndpoints: true,
30+
showNotebooksForCI: true,
3031
})
3132
.then(() => {
3233
cy.getByTestID('nav-item-flows').should('be.visible')

cypress/e2e/shared/flowsSidebarExportToClipboard.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,21 @@ describe('Flows Copy To Clipboard', () => {
110110
cy.get('@org').then(({id}: Organization) => {
111111
cy.fixture('routes').then(({orgs}) => {
112112
cy.visit(`${orgs}/${id}`)
113-
114113
cy.createNotebook(id).then(() => {
115114
cy.reload()
116115
})
117116
})
118117
})
119-
cy.getByTestID('tree-nav')
120-
121-
cy.clickNavBarItem('nav-item-flows')
122-
cy.intercept('PATCH', `/api/v2private/notebooks/*`).as(
123-
'NotebooksPatchRequest'
124-
)
118+
cy.setFeatureFlags({
119+
showNotebooksForCI: true,
120+
}).then(() => {
121+
cy.getByTestID('tree-nav')
122+
123+
cy.clickNavBarItem('nav-item-flows')
124+
cy.intercept('PATCH', `/api/v2private/notebooks/*`).as(
125+
'NotebooksPatchRequest'
126+
)
127+
})
125128
})
126129
})
127130

cypress/e2e/shared/legends.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,12 @@ describe('Legends', () => {
558558
cy.createNotebook(id).then(() => {
559559
cy.reload()
560560
})
561-
cy.visit(`${orgs}/${id}${notebooks}`)
562-
cy.getByTestID('tree-nav').should('be.visible')
561+
cy.setFeatureFlags({
562+
showNotebooksForCI: true,
563+
}).then(() => {
564+
cy.visit(`${orgs}/${id}${notebooks}`)
565+
cy.getByTestID('tree-nav').should('be.visible')
566+
})
563567
})
564568
})
565569
})

cypress/e2e/shared/secrets.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ describe('Secrets', () => {
128128
cy.get('@org').then(({id}: Organization) =>
129129
cy.fixture('routes').then(({orgs}) => {
130130
cy.visit(`${orgs}/${id}`)
131+
cy.setFeatureFlags({
132+
showNotebooksForCI: true,
133+
})
131134
cy.createNotebook(id).then(() => {
132135
cy.reload()
133136
})

cypress/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
createBucket,
3232
createScraper,
3333
createView,
34+
createNotebook,
3435
fluxEqual,
3536
createTelegraf,
3637
createToken,
@@ -79,6 +80,7 @@ declare global {
7980
createDashWithCell: typeof createDashWithCell
8081
createDashWithViewAndVar: typeof createDashWithViewAndVar
8182
createView: typeof createView
83+
createNotebook: typeof createNotebook
8284
createOrg: typeof createOrg
8385
deleteOrg: typeof deleteOrg
8486
flush: typeof flush

src/flows/selectors/flowsSelectors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {AppState} from 'src/types'
44
import {CLOUD, IOX_SWITCHOVER_CREATION_DATE} from 'src/shared/constants'
55

66
import {selectOrgCreationDate} from 'src/organizations/selectors'
7+
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
78

89
export const selectNotebooks = (state: AppState): Notebook[] => {
910
return state.resources.notebooks.notebooks
@@ -20,7 +21,7 @@ export const selectShouldShowNotebooks = (state: AppState): boolean => {
2021
}
2122

2223
// In cloud, don't show notebooks for any org created after the IOx cutover date
23-
if (!wasCreatedBeforeIOxCutoff) {
24+
if (!wasCreatedBeforeIOxCutoff && !isFlagEnabled('showNotebooksForCI')) {
2425
return false
2526
}
2627

0 commit comments

Comments
 (0)