Skip to content
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

Re-enable dataset_selector.spec.js and queries.spec.js under workspace #9082

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Dec 19, 2024

Description

  • dataset_selector.spec.js
2024-12-19_14-52-14.mp4
  • queries.spec.js
2024-12-19_18-59-21.mp4

Note:

const scopedHistoryNavigationError = /^[^(ScopedHistory instance has fell out of navigation scope)]/;
Cypress.on('uncaught:exception', (err) => {
  /* returning false here prevents Cypress from failing the test */
  if (scopedHistoryNavigationError.test(err.message)) {
    return false;
  }
});

is from #9047

Issues Resolved

#9182
#9186

Changelog

  • test: Re-enable dataset_selector.spec.js under workspace in ciGroup10

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@@ -5,3 +5,5 @@

export const DATASOURCE_NAME = 'query-cluster';
export const WORKSPACE_NAME = 'query-workspace';
export const START_TIME = 'Dec 31, 2020 @ 00:00:00.000';
export const END_TIME = 'Dec 31, 2022 @ 23:59:59.999';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we relax these dates to not make it so close to our dataset? more convo here: #9047 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. let me update it with other comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.90%. Comparing base (f85cd6d) to head (bc81125).
Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9082      +/-   ##
==========================================
+ Coverage   60.86%   60.90%   +0.03%     
==========================================
  Files        3808     3808              
  Lines       91175    91178       +3     
  Branches    14396    14396              
==========================================
+ Hits        55495    55531      +36     
+ Misses      32140    32094      -46     
- Partials     3540     3553      +13     
Flag Coverage Δ
Linux_1 28.99% <ø> (-0.01%) ⬇️
Linux_2 56.38% <ø> (-0.01%) ⬇️
Linux_3 38.01% <ø> (+0.06%) ⬆️
Linux_4 29.01% <ø> (-0.01%) ⬇️
Windows_1 29.00% <ø> (-0.01%) ⬇️
Windows_2 56.34% <ø> (-0.01%) ⬇️
Windows_3 38.01% <ø> (+0.06%) ⬆️
Windows_4 29.01% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ananzh ananzh changed the title Re-enable dataset_selector.spec.js under workspace Re-enable dataset_selector.spec.js and queries.spec.js under workspace Dec 20, 2024
opensearch-changeset-bot bot added a commit to ananzh/OpenSearch-Dashboards that referenced this pull request Dec 20, 2024
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
const miscUtils = new MiscUtils(cy);
Copy link
Collaborator

@LDrago27 LDrago27 Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the MiscUtils since we are only using this to for navigation which we can do using the cypress commands.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan to migrate MiscUtils.visitPage from lib to our cypress in a follow up

Copy link
Member Author

@ananzh ananzh Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

AMoo-Miki
AMoo-Miki previously approved these changes Dec 20, 2024
Signed-off-by: Anan <[email protected]>
opensearch-changeset-bot bot added a commit to ananzh/OpenSearch-Dashboards that referenced this pull request Dec 20, 2024
const testFixtureHandler = new TestFixtureHandler(cy, PATHS.ENGINE);

describe.skip('dataset selector', { scrollBehavior: false }, () => {
describe('empty state', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we delete the test for testing the empty state? i think we do need to test when there is no index pattern

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we moved it to a_check.spec.js

cy.waitForSearch();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');
cy.get('[class="euiText euiText--small"]').then((text) => cy.log(text));
cy.verifyHitCount(4);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we delete verifying the hit count? If we delete verifying hit count, how are we ensuring the query is persisted across refresh?

Feel like cy.getElementByTestId(queryResultCompleteMsg).should('be.visible'); only does not provide valid proof

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. I added cy.verifyHitCount('10,000');

@ananzh ananzh merged commit 66331eb into opensearch-project:main Dec 20, 2024
69 checks passed
@ananzh ananzh added the discover_2.0-test Issues that are specific to the Discover 2.0 testing initiative label Jan 10, 2025
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this pull request Jan 23, 2025
opensearch-project#9082)

* Re-enable dataset_selector.spec.js and queries.spec.js under workspace

Signed-off-by: Anan <[email protected]>

* fix comment

Signed-off-by: Anan <[email protected]>

* add verifyHitCount for PPL

Signed-off-by: Anan <[email protected]>

* Changeset file for PR opensearch-project#9082 created/updated

---------

Signed-off-by: Anan <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
ananzh added a commit that referenced this pull request Jan 23, 2025
…ing backports (#9261)

* [Discover] Makes caching dataset options optional (#8799)

* [Discover] Makes caching dataset options optional.

* Adds unit test

* Changeset file for PR #8799 created/updated

* Update test

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kawika Avilla <[email protected]>

* Upgrade Cypress to v12 (#8995)

* Update Cypress to v12 (#8926)

* Update cypress to v12

Signed-off-by: Daniel Rowe <[email protected]>

* Add required e2e.js

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #8926 created/updated

* Update license header

Signed-off-by: Daniel Rowe <[email protected]>

* Update license in e2e.js

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* fix: support imports without extensions in cypress webpack build (#8993)

* fix: support imports without extensions in cypress webpack build

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #8993 created/updated

* use typescript config

Signed-off-by: Daniel Rowe <[email protected]>

* fix lint

Signed-off-by: Daniel Rowe <[email protected]>

* disable new test isolation feature

This isolation was causing regressions

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [Discover Test] TestID-69: Filtering. Add data-test-subj tags. (#9027)

* Update Cypress to v12 (#8926)

* Update cypress to v12

Signed-off-by: Daniel Rowe <[email protected]>

* Add required e2e.js

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #8926 created/updated

* Update license header

Signed-off-by: Daniel Rowe <[email protected]>

* Update license in e2e.js

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* fix: support imports without extensions in cypress webpack build (#8993)

* fix: support imports without extensions in cypress webpack build

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #8993 created/updated

* use typescript config

Signed-off-by: Daniel Rowe <[email protected]>

* fix lint

Signed-off-by: Daniel Rowe <[email protected]>

* disable new test isolation feature

This isolation was causing regressions

Signed-off-by: Daniel Rowe <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* Add data-test-subj tags.

Signed-off-by: Argus Li <[email protected]>

---------

Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* Migrate query enhancement tests from functional repo to main (#9048)

* migrate query enhacenement tests

Signed-off-by: abbyhu2000 <[email protected]>

* ignore lint in data files

Signed-off-by: abbyhu2000 <[email protected]>

* remove yarn lock changes

Signed-off-by: abbyhu2000 <[email protected]>

* add changelog

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* Add missing data-test-subj tags for discover plugin (#9049)

* Add data-test-subj for discover
Signed-off-by: Anan Zhuang <[email protected]>
* fix comment
Signed-off-by: Anan Zhuang <[email protected]>

---------

Signed-off-by: Anan Zhuang <[email protected]>

* Add missing data-test-subj tags for data plugin (#9051)

* Add missing data-test-subj tags for data plugin
* Update Snapshots
* Fix as per the comments

---------

Signed-off-by: Suchit Sahoo <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Follow up on #9048 by updating data and utilities (#9060)

* Follow up on #9048 by updating data and utilities

Feature branch PRs:
#9038
#9006

Signed-off-by: Anan <[email protected]>

* fix comment

Signed-off-by: Anan <[email protected]>

* update path and add utility from suchit commit

Signed-off-by: Anan <[email protected]>

* update the path to run sample test

Signed-off-by: Anan <[email protected]>

* fix PR comments

Signed-off-by: Anan <[email protected]>

* skip tests before enable workspace

Signed-off-by: Anan <[email protected]>

---------

Signed-off-by: Anan <[email protected]>

* refactor some query-enhancement utility functions, add some missing typings (#9074)

* refactor some query-enhancement utility functions, add some missing typings

Signed-off-by: Justin Kim <[email protected]>

* Changeset file for PR #9074 created/updated

---------

Signed-off-by: Justin Kim <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* add queryEditorLanguageOptions data-test-subj on language_selector.tsx (#9029)

Signed-off-by: Federico Silva <[email protected]>
Co-authored-by: Federico Silva <[email protected]>

* Re-enable dataset_selector.spec.js and queries.spec.js under workspace (#9082)

* Re-enable dataset_selector.spec.js and queries.spec.js under workspace

Signed-off-by: Anan <[email protected]>

* fix comment

Signed-off-by: Anan <[email protected]>

* add verifyHitCount for PPL

Signed-off-by: Anan <[email protected]>

* Changeset file for PR #9082 created/updated

---------

Signed-off-by: Anan <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* Make createWorkspaceIndexPatterns to handle no default cluster and clean up (#9129)

* Make createWorkspaceIndexPatterns to handle no default cluster and clean up

Signed-off-by: Anan <[email protected]>

* Changeset file for PR #9129 created/updated

---------

Signed-off-by: Anan <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* add data-test-subj (#9135)

Signed-off-by: Federico Silva <[email protected]>

* [Discover] Adding Cypress Tests for S3 Datasets (#9113)

* [Discover 2.0 Testing] Create Filtering Test (TestId-69: Filtering) (#9119)

* Add test for filtering functionality for discover, which enables query enhancement
* Make test more robust: Add logic to use date picker start and end buttons if set to absolute times. Check the table length directly instead of number of hits to avoid bug where not all results load.

---------

Signed-off-by: Argus Li <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* Add tests for saved search creation and loading for query enhancement (#9112)

* Add tests for saved search creation and loading for query enhancement
* click on a random element before typing on query editor to bypass the popover that appears
* address pr comments - refactor to create saved search as an api call
* address pr comments - specifically navigate to discover page before setting datasource

Signed-off-by: Justin Kim <[email protected]>

---------

Signed-off-by: Justin Kim <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <[email protected]>

* fix: 0 rendered in discover when there are no results (#9153)

* fix: 0 rendered in discover when there are no results

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #9153 created/updated

---------

Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [Cypress][Fix] Update saved search utilities (#9151)

* update saved search
* minor refactor4 on setDatePickerDatesAndSearchIfRelevant

Signed-off-by: Justin Kim <[email protected]>

---------

Signed-off-by: Justin Kim <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* chore: use relative paths in cypress (#9079)

* chore: use relative paths in cypress

when we move to running tests in parallel we won't be able to use a single
hardcoded basepath as these can differ by tasks

Signed-off-by: Daniel Rowe <[email protected]>

* Changeset file for PR #9079 created/updated

---------

Signed-off-by: Daniel Rowe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [Discover 2.0 Testing] Create View List of Saved Queries Test (Test-Id 124: View list of Saved query)  (#9166)

* add spec for old ui

Signed-off-by: Argus Li <[email protected]>

* Add comment about cleaning up saved queries

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for save query button for new ui

Signed-off-by: Argus Li <[email protected]>

* Add data-test-subj for open query button in query management popover

Signed-off-by: Argus Li <[email protected]>

* Add new ui spec to test list saved queries

Signed-off-by: Argus Li <[email protected]>

* Fix DataSource url

Signed-off-by: Argus Li <[email protected]>

* Changeset file for PR #9166 created/updated

* Address Justin's comments.

Signed-off-by: Argus Li <[email protected]>

* Remove final force.

Signed-off-by: Argus Li <[email protected]>

* Fix final force.

Signed-off-by: Argus Li <[email protected]>

* Move utils to Suchit's suggested location, fix comments

Signed-off-by: Argus Li <[email protected]>

* Rename specs, change cypress workflow to use new save query ui, merge old ui and new ui commands

Signed-off-by: Argus Li <[email protected]>

* fix import

Signed-off-by: Argus Li <[email protected]>

---------

Signed-off-by: Argus Li <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* change casing to folder structures to be compliant with our rules (#9197)

Signed-off-by: Justin Kim <[email protected]>

* [Fix] Saved Search Integ Test Update: update saving a new saved search test spec (#9200)

* wait for the page to be loaded before loading a saved search
* when loading a saved search and saving it as a new saved search, use a different name

Signed-off-by: Justin Kim <[email protected]>

---------

Signed-off-by: Justin Kim <[email protected]>

* refactor query enhancement tests (#9208)

Signed-off-by: Justin Kim <[email protected]>

* chore: change casing of data-logs to be compliant with our git hook rules (#9220)

Signed-off-by: Justin Kim <[email protected]>

* chore: remove unused/redundant functions from field_display_filtering utils (#9219)

Signed-off-by: Justin Kim <[email protected]>

* Create cypress command namespacing util (#9150)

* update cy.createInitialWorkspaceWithDataSource -> cy.osd.createInitialWorkspaceWithDataSource (#9262)

Signed-off-by: Justin Kim <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Daniel Rowe <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: Anan <[email protected]>
Signed-off-by: Justin Kim <[email protected]>
Signed-off-by: Federico Silva <[email protected]>
Signed-off-by: Federico Silva <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Kawika Avilla <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: Argus Li <[email protected]>
Co-authored-by: Daniel Rowe <[email protected]>
Co-authored-by: Qingyang(Abby) Hu <[email protected]>
Co-authored-by: Suchit Sahoo <[email protected]>
Co-authored-by: Justin Kim <[email protected]>
Co-authored-by: Federico Silva <[email protected]>
Co-authored-by: Federico Silva <[email protected]>
Co-authored-by: Federico Silva <[email protected]>
Co-authored-by: Sean Li <[email protected]>
Co-authored-by: d rowe <[email protected]>
@ananzh ananzh added the v2.19.0 label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discover_2.0-test Issues that are specific to the Discover 2.0 testing initiative distinguished-contributor v2.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants