-
Notifications
You must be signed in to change notification settings - Fork 935
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
[Cypress Test] Add and Refactor TESTID-140 sidebar spec and TESTID-46,47,49 sharing spec #9154
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9154 +/- ##
==========================================
- Coverage 61.70% 61.70% -0.01%
==========================================
Files 3816 3816
Lines 91824 91824
Branches 14542 14542
==========================================
- Hits 56664 56662 -2
- Misses 31506 31507 +1
- Partials 3654 3655 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
bd60d37
to
c6e7933
Compare
cy.get('.view-line').type(query); | ||
// Send query | ||
cy.getElementByTestId('querySubmitButton').click(); | ||
}; |
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.
is this funciton needed? can we remove it and use this instead?
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.
removed
*/ | ||
|
||
/** | ||
* Returns the SideBarTestConfig for the provided dataset, datasetType, and language |
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.
* Returns the SideBarTestConfig for the provided dataset, datasetType, and language | |
* Returns the FieldDisplayFilteringTestConfig for the provided dataset, datasetType, and language |
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.
updated
* @param {string} dataset - the dataset name | ||
* @param {QueryEnhancementDataset} datasetType - the type of the dataset | ||
* @param {QueryEnhancementLanguageData} language - the relevant data for the query language to use | ||
* @returns {SideBarTestConfig} |
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.
* @returns {SideBarTestConfig} | |
* @returns {FieldDisplayFilteringTestConfig} |
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.
updated
* @property {string} dataset - the dataset name to use | ||
* @property {QueryEnhancementDataset} datasetType - the type of dataset | ||
* @property {QueryEnhancementLanguage} language - the name of query language as it appears in the dashboard app | ||
* @property {boolean} isFilterButtonsEnabled - whether filter button is enabled for this permutation |
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.
* @property {boolean} isFilterButtonsEnabled - whether filter button is enabled for this permutation |
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.
done
* @returns {object[]} | ||
*/ | ||
export const generateAllTestConfigurations = (generateTestConfigurationCallback) => { | ||
export const generateAllTestConfigurations = (generateTestConfigurationCallback, options = {}) => { | ||
const { indexPattern = INDEX_PATTERN_WITH_TIME, index = INDEX_WITH_TIME_1 } = options; |
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'm fine with this change, but looking at it's usage in this PR, it looks like the only change is:
indexPattern: 'data_logs_small_time_1*',
Can't we just change this to data_logs_small_time_*
?
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.
But irreglardless of my questions, lets keep this change (i found an issue when migrating that'll make this useful!)
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.
Yeah I want it to be more general. So you can define what is index patten and index.
config | ||
) => { | ||
// Helper functions | ||
const getDocTableHeaderByIndex = (index) => |
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.
Do we want to move these helper functions into the sidebar.js
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 am considering it. But it should be a function in table canvas which is TESTID-147. Will update when raise the PR for TESTID-147.
}; | ||
|
||
describe('sidebar spec', () => { | ||
before(() => { |
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.
We should change the before
into beforeEach
and consolidate the after
and afterEach
blocks
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 will remove before. I have kept one in config which should not affect.
c6e7933
to
c42e778
Compare
98f25c0
to
38fb073
Compare
38fb073
to
44819bf
Compare
c5e094a
to
c4193be
Compare
Issue Resolved Partially opensearch-project#8946 opensearch-project#8954 opensearch-project#8952 opensearch-project#8953 Signed-off-by: Anan <[email protected]>
c58b86f
to
b1378d4
Compare
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.
Approving the PR but lets look into why we need to tear down and add data every time to OpenSearch. Seems very inefficient
interval: 'w', | ||
filter: ['category', 'Network'], | ||
}; | ||
beforeEach(() => { |
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.
This seems really inefficient! Why do we need to do this for every test? Our test suite will blow up!
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.
this is for @AMoo-Miki 's future test plan design to isolate each test cases and run parallelly.
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-9154-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a50e0c74f5bf87903ec6b6d82c131d1fc20b4a29
# Push it to GitHub
git push --set-upstream origin backport/backport-9154-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.19 2.19
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.19
# Create a new branch
git switch --create backport/backport-9154-to-2.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a50e0c74f5bf87903ec6b6d82c131d1fc20b4a29
# Push it to GitHub
git push --set-upstream origin backport/backport-9154-to-2.19
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.19 Then, create a pull request where the |
Description
Issues Resolved
Partially #8946
#8954
#8952
#8953
Screenshot
Changelog
Check List
yarn test:jest
yarn test:jest_integration