-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: turn on SQLLAB_BACKEND_PERSISTENCE by default #19107
Merged
ktmud
merged 5 commits into
apache:master
from
airbnb:sqllab-backend-persist-default-on
Mar 18, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 0 additions & 65 deletions
65
superset-frontend/cypress-base/cypress/integration/sqllab/tabs.test.js
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
superset-frontend/cypress-base/cypress/integration/sqllab/tabs.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
describe('SqlLab query tabs', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
cy.visit('/superset/sqllab'); | ||
}); | ||
|
||
it('allows you to create and close a tab', () => { | ||
const tablistSelector = '[data-test="sql-editor-tabs"] > [role="tablist"]'; | ||
const tabSelector = `${tablistSelector} [role="tab"]`; | ||
cy.get(tabSelector).then(tabs => { | ||
const initialTabCount = tabs.length; | ||
const initialUntitledCount = Math.max( | ||
0, | ||
...tabs | ||
.map((i, tabItem) => | ||
Number(tabItem.textContent?.match(/Untitled Query (\d+)/)?.[1]), | ||
) | ||
.toArray(), | ||
); | ||
|
||
// add two new tabs | ||
cy.get('[data-test="add-tab-icon"]:visible:last').click(); | ||
cy.contains('[role="tab"]', `Untitled Query ${initialUntitledCount + 1}`); | ||
cy.get(tabSelector).should('have.length', initialTabCount + 1); | ||
|
||
cy.get('[data-test="add-tab-icon"]:visible:last').click(); | ||
cy.contains('[role="tab"]', `Untitled Query ${initialUntitledCount + 2}`); | ||
cy.get(tabSelector).should('have.length', initialTabCount + 2); | ||
|
||
// close the tabs | ||
cy.get(`${tabSelector}:last [data-test="dropdown-trigger"]`).click({ | ||
force: true, | ||
}); | ||
cy.get('[data-test="close-tab-menu-option"]').click(); | ||
cy.get(tabSelector).should('have.length', initialTabCount + 1); | ||
cy.contains('[role="tab"]', `Untitled Query ${initialUntitledCount + 1}`); | ||
|
||
cy.get(`${tablistSelector} [aria-label="remove"]:last`).click(); | ||
cy.get(tabSelector).should('have.length', initialTabCount); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ import React from 'react'; | |
import { styled } from '@superset-ui/core'; | ||
import { CheckboxChecked, CheckboxUnchecked } from 'src/components/Checkbox'; | ||
|
||
interface CheckboxProps { | ||
export interface CheckboxProps { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bycatch: fix this missing export. For some reason, this is causing Cypress test on SQL tabs to fail locally. |
||
checked: boolean; | ||
onChange: (val?: boolean) => void; | ||
style?: React.CSSProperties; | ||
|
@@ -49,5 +49,3 @@ export default function Checkbox({ checked, onChange, style }: CheckboxProps) { | |
</Styles> | ||
); | ||
} | ||
|
||
export type { CheckboxProps }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rewritten the tests for SQL Lab Tabs to make them more re-runnable---so that if you have any backend persistent tabs, the tab names are still named correctly following the logics here.
cc @cccs-Dustin @kgabryje