Skip to content

Commit

Permalink
Manual Backport all tests PRs to 2.x (#9486)
Browse files Browse the repository at this point in the history
* [Cypress][TESTID-147] Add tests for table canvas in discover (#9285)

* [Cypress][TESTID-147] Add tests for table canvas in discover

Issue resolved:
#8947

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

* Changeset file for PR #9285 created/updated

---------

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

* [TESTID-58,59] Inspect functionality for Discover and Visualizations (#9292)

* Complete discover inspect tests.

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

* Complete visualizations and fix PPL array type.

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

* Changeset file for PR #9292 created/updated

* Fix docker URL for datasource.

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

* Fix namespace issue.

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

* Address comments.

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

* Fix import

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

* Fix import.

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

* Add spec to cigroup 10 and 12.

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

* Remove test from CI Group 10.

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

* Make field display filtering use randomized datasource name

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

* Address comments.

Removed a log and a wait.

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>

* [TEST] refactor all tests to be consistent across different source codes (#9319)

* refactor all tests to be consistent across different source codes

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

* remove openWorkspaceDashboard from osd

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

* address comments

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

* fix broken tests

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

---------

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

* [TEST] update tests to use only data-logs-1 (#9339)

* update tests to use only data-logs-1

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

* make engine and secondary_engine optional

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

* update a few more things

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

---------

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

* Add ciGroup13 for query tests (#9345)

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

* Add retry mechanism for flaky share menu test (#9352)

* Add retry mechanism for flaky share menu test

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

* Changeset file for PR #9352 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 a check for the sort visibility in language_specific_display (#9314)

* add a check for the sort visibility in language_specific_display

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

* Changeset file for PR #9314 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>

* remove data explorer elements (#9359)

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

* [TESTID-77] Index Patterns Caching functionality for Discover (#9331)

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Refactor based on #9319

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

* Update package.json

Signed-off-by: Suchit Sahoo <[email protected]>

* Remove element.js

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

---------

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

* [TESTID-64,80,UI] Add cypress test for autocomplete feature (#9322)

* [TESTID-64,80,UI] Add cypress test for autocomplete feature

Add tests related to autocomplete. This will close all the issues listed here:

https://github.com/opensearch-project/OpenSearch-Dashboards/issues/assigned/ananzh?q=is%3Aissue%20assignee%3Aananzh%20label%3A%22discover%20autocomplete%22%20

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

* Changeset file for PR #9322 created/updated

---------

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

* [TESTID-17] Add tests for query testing and advanced settings (#9384)

Issue Resolved:
#8934

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

* [Recent Queries]: add all recent queries tests (#9307)

* add max recent queries tests

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

* refactor callback function

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

* add testid-42 tests

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

* add comments

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

* add spec to package.json

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

* fix testconfig fn name

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

* fix clipboard flakiness

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

* refactor test preparation

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

* fix package.json, yarn.locl and cypress.config.ts

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

* Changeset file for PR #9307 created/updated

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

* remove element.js references

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

* [Documentation] Add alternative Docker Development Environment Setup documentation. (#9362)

* Add alternative Docker Development Environment Setup.

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

* Changeset file for PR #9362 created/updated

* Use relative link

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

* Address Suchit's comments.

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>
Signed-off-by: Federico Silva <[email protected]>

* [TESTID-77] Index Patterns Caching functionality for Discover (#9331)

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Refactor based on #9319

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

* Update package.json

Signed-off-by: Suchit Sahoo <[email protected]>

* Remove element.js

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

---------

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

* comment out tests with dependencies

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

* [Discover] fix: Clean up sync URL subscription in Discover plugin topNav (#9316)

* [Discover] fix: Clean up sync URL subscription in Discover plugin topNav

Signed-off-by: Joey Liu <[email protected]>

* Changeset file for PR #9316 created/updated

* Update unit test

Signed-off-by: Joey Liu <[email protected]>

* Revert save modal change

Signed-off-by: Joey Liu <[email protected]>

---------

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

* [TESTID-64,80,UI] Add cypress test for autocomplete feature (#9322)

* [TESTID-64,80,UI] Add cypress test for autocomplete feature

Add tests related to autocomplete. This will close all the issues listed here:

https://github.com/opensearch-project/OpenSearch-Dashboards/issues/assigned/ananzh?q=is%3Aissue%20assignee%3Aananzh%20label%3A%22discover%20autocomplete%22%20

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

* Changeset file for PR #9322 created/updated

---------

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

* [Discover] chore: Update query editor loading UI (#9344)

* [Discover] chore: Update query editor loading UI

* Move progress bar position

Signed-off-by: Joey Liu <[email protected]>

* Update loading text font

Signed-off-by: Joey Liu <[email protected]>

* update unit test snapshot

Signed-off-by: Joey Liu <[email protected]>

* Update single line query editor

Signed-off-by: Joey Liu <[email protected]>

* Changeset file for PR #9344 created/updated

* pull doc update

Signed-off-by: Joey Liu <[email protected]>

---------

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

* feat(vis_type_vega): support reading time field (#9152)

* feat(vis_type_vega): support reading time field

Signed-off-by: Yulong Ruan <[email protected]>

* Changeset file for PR #9152 created/updated

* fix time format to use moment.utc

Signed-off-by: Yulong Ruan <[email protected]>

---------

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

* [TESTID-17] Add tests for query testing and advanced settings (#9384)

Issue Resolved:
#8934

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

---------

Signed-off-by: Federico Silva <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: Joey Liu <[email protected]>
Signed-off-by: Anan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Argus Li <[email protected]>
Co-authored-by: Suchit Sahoo <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
Co-authored-by: Joey Liu <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>

* [TESTID-66] Add histogram tests (#9290)

* Update actions/cache from v1 to v4 to address deprecation warning (#9366)

* build: Update actions/cache from v1 to v4 to address deprecation warning

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

* Changeset file for PR #9366 created/updated

---------

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

* Handle invalid geospatial request in region map (#8759)

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

* Update DEVELOPER_GUIDE.md (#9368)

When building the OpenSearch Dashboards artifact for Linux, the build may fail on certain distributions. This issue stems from the recent upgrade from node-sass to dart-sass. The new process uses an embeddable module from dart-sass to process Sass files, which relies on a platform-specific compiler. On Linux, this module depends on glibc. However, some distributions—like Alpine Linux—use musl libc instead, which is incompatible with this module. I'm updating the DEVELOPER_GUIDE documentation to help other developers choose the appropriate distro for Docker images and avoid the pitfalls I encountered.
See the issue I created in Github explaining this reasoning: #9329
Also the forum where I posted the kind of error you see when building with a Linux Distribution that is incompatible with glibc: https://forum.opensearch.org/t/docker-a-error-error-worker-exitted-unexpectedly-with-code-1-last-message-bundleid-embeddable-type-running/23214

Signed-off-by: Luis Beltrán <[email protected]>
Signed-off-by: Federico Silva <[email protected]>

* create histogram tests

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

* update callback, refactor tests

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

* fix hooks

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

* add comments to code, refactor preconditions

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

* update hooks to beforeEach and afterEach for CI/CD

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

* Changeset file for PR #9290 created/updated

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

* add todos

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

* add to package.json

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

* remove elements.js references

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

* [Documentation] Add alternative Docker Development Environment Setup documentation. (#9362)

* Add alternative Docker Development Environment Setup.

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

* Changeset file for PR #9362 created/updated

* Use relative link

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

* Address Suchit's comments.

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>
Signed-off-by: Federico Silva <[email protected]>

* [TESTID-77] Index Patterns Caching functionality for Discover (#9331)

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Create caching test.

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

* Changeset file for PR #9331 created/updated

* Refactor based on #9319

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

* Update package.json

Signed-off-by: Suchit Sahoo <[email protected]>

* Remove element.js

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

---------

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

* [Discover] fix: Clean up sync URL subscription in Discover plugin topNav (#9316)

* [Discover] fix: Clean up sync URL subscription in Discover plugin topNav

Signed-off-by: Joey Liu <[email protected]>

* Changeset file for PR #9316 created/updated

* Update unit test

Signed-off-by: Joey Liu <[email protected]>

* Revert save modal change

Signed-off-by: Joey Liu <[email protected]>

---------

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

* skip permutation for SQL

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

* add todo

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

* [TESTID-64,80,UI] Add cypress test for autocomplete feature (#9322)

* [TESTID-64,80,UI] Add cypress test for autocomplete feature

Add tests related to autocomplete. This will close all the issues listed here:

https://github.com/opensearch-project/OpenSearch-Dashboards/issues/assigned/ananzh?q=is%3Aissue%20assignee%3Aananzh%20label%3A%22discover%20autocomplete%22%20

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

* Changeset file for PR #9322 created/updated

---------

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

* [Discover] chore: Update query editor loading UI (#9344)

* [Discover] chore: Update query editor loading UI

* Move progress bar position

Signed-off-by: Joey Liu <[email protected]>

* Update loading text font

Signed-off-by: Joey Liu <[email protected]>

* update unit test snapshot

Signed-off-by: Joey Liu <[email protected]>

* Update single line query editor

Signed-off-by: Joey Liu <[email protected]>

* Changeset file for PR #9344 created/updated

* pull doc update

Signed-off-by: Joey Liu <[email protected]>

---------

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

* feat(vis_type_vega): support reading time field (#9152)

* feat(vis_type_vega): support reading time field

Signed-off-by: Yulong Ruan <[email protected]>

* Changeset file for PR #9152 created/updated

* fix time format to use moment.utc

Signed-off-by: Yulong Ruan <[email protected]>

---------

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

* [TESTID-17] Add tests for query testing and advanced settings (#9384)

Issue Resolved:
#8934

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

* add to package.json

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

---------

Signed-off-by: Anan <[email protected]>
Signed-off-by: Federico Silva <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Luis Beltrán <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: Joey Liu <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Junqiu Lei <[email protected]>
Co-authored-by: Luis Beltrán <[email protected]>
Co-authored-by: Argus Li <[email protected]>
Co-authored-by: Suchit Sahoo <[email protected]>
Co-authored-by: Joey Liu <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>

* Remove reload in saved_search spec as bug has been resolved (#9396)

* Remove reload as bug has been resolved.

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

* Changeset file for PR #9396 created/updated

---------

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

* [TESTID-140 New Test Suites] Top Values and Filter Sidebar Fields By Type functionality for Discover (#9386)

* Finish top values test scenario.

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

* Add filtering fields by type

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

* Changeset file for PR #9386 created/updated

* Fix Datasource url

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>

* [Follow-up #9386] Add TODO and omit for hide missing values for SQL and PPL (#9402)

Follow-up PR:
#9386

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

* [TESTID-234] Add tests for query editor display (#9398)

* [TESTID-234] Add tests for query editor display

Issue Resolved:
#9267

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

* Changeset file for PR #9398 created/updated

---------

Signed-off-by: Anan <[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>

* Fix flakieness in cypress tests (#9433)

* Fix flakieness in cypress tests

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

* Changeset file for PR #9433 created/updated

---------

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

* [TEST] add more osd namespacing (#9358)

* add more osd namespacing

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

* fix imports

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

* fix some flakiness in neo

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

* add back in workspace_plugin commands

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

* couple more changes

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

* couple more changes

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

* fix some namespace issue when rebasing to include caching.spec.js

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

* adding more changes

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

* adding more changes

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

* more change

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes and try adding retries

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* more changes

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

* fix broken tests

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

---------

Signed-off-by: Justin Kim <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* add setting sort for PPL and SQL for inspect.spec (#9444)

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

* [TEST] use before/after and consolidate (#9439)

---------

Signed-off-by: Anan <[email protected]>
Signed-off-by: Argus Li <[email protected]>
Signed-off-by: Justin Kim <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: Federico Silva <[email protected]>
Signed-off-by: Joey Liu <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Luis Beltrán <[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: Argus Li <[email protected]>
Co-authored-by: Justin Kim <[email protected]>
Co-authored-by: Suchit Sahoo <[email protected]>
Co-authored-by: Federico Silva <[email protected]>
Co-authored-by: Joey Liu <[email protected]>
Co-authored-by: Yulong Ruan <[email protected]>
Co-authored-by: Junqiu Lei <[email protected]>
Co-authored-by: Luis Beltrán <[email protected]>
  • Loading branch information
10 people authored Mar 7, 2025
1 parent 06f0198 commit 1882311
Show file tree
Hide file tree
Showing 88 changed files with 5,341 additions and 2,643 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ jobs:
- group: 12
config: query_enhanced
test_location: source
# Dashboard tests with query enhanced - group 3
- group: 13
config: query_enhanced
test_location: source
# Dashboard tests with query enhanced - group 4
- group: 14
config: query_enhanced
test_location: source
# Dashboard tests with query enhanced - group 5
- group: 15
config: query_enhanced
test_location: source
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/9285.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- [Cypress][TESTID-147] Add tests for table canvas in discover ([#9285](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9285))
2 changes: 2 additions & 0 deletions changelogs/fragments/9290.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add histogram interaction tests ([#9290](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9290))
2 changes: 2 additions & 0 deletions changelogs/fragments/9292.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add cypress integration test for the inspect functionality in the Discover and Dashboards pages. ([#9292](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9292))
2 changes: 2 additions & 0 deletions changelogs/fragments/9307.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add all recent queries tests ([#9307](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9307))
2 changes: 2 additions & 0 deletions changelogs/fragments/9314.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Test sort in language_specific_display ([#9314](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9314))
2 changes: 2 additions & 0 deletions changelogs/fragments/9322.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- [TESTID-64] Add cypress test for auto query updates when switch dataset ([#9322](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9322))
2 changes: 2 additions & 0 deletions changelogs/fragments/9331.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add cypress integration test for the inspect functionality in the Discover and Dashboards pages. ([#9331](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9331))
2 changes: 2 additions & 0 deletions changelogs/fragments/9352.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add retry mechanism for flaky share menu test ([#9352](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9352))
2 changes: 2 additions & 0 deletions changelogs/fragments/9386.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add Top Values and Filter Sidebar Fields by Type testing for the Discover Page. ([#9386](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9386))
2 changes: 2 additions & 0 deletions changelogs/fragments/9396.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Remove unnecessary reload in saved_search test. ([#9396](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9396))
2 changes: 2 additions & 0 deletions changelogs/fragments/9398.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- [TESTID-234] Add tests for query editor display ([#9398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9398))
2 changes: 2 additions & 0 deletions changelogs/fragments/9433.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Fix flakieness in cypress tests ([#9433](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9433))
2 changes: 2 additions & 0 deletions changelogs/fragments/9439.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Use before/after to speed up test ([#9439](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9439))
15 changes: 14 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import { defineConfig } from 'cypress';
import webpackPreprocessor from '@cypress/webpack-preprocessor';
// TODO: import { paste } from 'copy-paste';

module.exports = defineConfig({
defaultCommandTimeout: 60000,
experimentalMemoryManagement: true,
defaultCommandTimeout: 15000,
requestTimeout: 60000,
responseTimeout: 60000,
retries: {
runMode: 2,
openMode: 0,
},
viewportWidth: 2000,
viewportHeight: 1320,
env: {
Expand Down Expand Up @@ -39,6 +45,7 @@ module.exports = defineConfig({
ML_COMMONS_DASHBOARDS_ENABLED: true,
WAIT_FOR_LOADER_BUFFER_MS: 0,
DISABLE_LOCAL_CLUSTER: false,
CYPRESS_RUNTIME_ENV: 'osd',
},
e2e: {
baseUrl: 'http://localhost:5601',
Expand Down Expand Up @@ -75,6 +82,12 @@ function setupNodeEvents(
webpackOptions,
})
);
// TODO: Define the custom task to read clipboard
/* on('task', {
readClipboard() {
return paste(); // Return the clipboard content
},
});*/

return config;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { INDEX_WITH_TIME_1 } from '../../../../../../utils/constants';
import { getRandomizedWorkspaceName } from '../../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

const noIndexPatternTestSuite = () => {
describe('No Index Pattern Check Test', () => {
before(() => {
cy.osd.setupWorkspaceAndDataSourceWithIndices(workspaceName, [INDEX_WITH_TIME_1]);
});

after(() => {
cy.osd.cleanupWorkspaceAndDataSourceAndIndices(workspaceName, [INDEX_WITH_TIME_1]);
});

describe('empty state', () => {
it('no index pattern', function () {
// Go to the Discover page
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName: workspaceName,
page: 'discover',
isEnhancement: true,
});
cy.osd.waitForLoader(true);
cy.getElementByTestId('discoverNoIndexPatterns').should('be.visible');
});
});
});
};

prepareTestSuite('a_check', noIndexPatternTestSuite);
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import {
DATASOURCE_NAME,
INDEX_WITH_TIME_1,
START_TIME,
END_TIME,
} from '../../../../../../utils/apps/constants';
import { getRandomizedWorkspaceName } from '../../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspace = getRandomizedWorkspaceName();

const queriesTestSuite = () => {
describe('query enhancement queries', { scrollBehavior: false }, () => {
before(() => {
cy.osd.setupWorkspaceAndDataSourceWithIndices(workspace, [INDEX_WITH_TIME_1]);
// Create and select index pattern for ${INDEX_WITH_TIME_1}*
cy.createWorkspaceIndexPatterns({
workspaceName: workspace,
indexPattern: INDEX_WITH_TIME_1,
timefieldName: 'timestamp',
indexPatternHasTimefield: true,
dataSource: DATASOURCE_NAME,
isEnhancement: true,
});
});

beforeEach(() => {
// Go to discover page
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName: workspace,
page: 'discover',
isEnhancement: true,
});
});

after(() => {
cy.osd.cleanupWorkspaceAndDataSourceAndIndices(workspace, [INDEX_WITH_TIME_1]);
});

describe('send queries', () => {
it('with DQL', () => {
cy.setIndexPatternAsDataset(`${INDEX_WITH_TIME_1}*`, DATASOURCE_NAME);
cy.setQueryLanguage('DQL');
cy.osd.setTopNavDate(START_TIME, END_TIME);

const query = `_id:N9srQ8opwBxGdIoQU3TW`;
cy.setQueryEditor(query);
cy.osd.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);

// Query should persist across refresh
cy.reload();
cy.verifyHitCount(1);
});

it('with Lucene', () => {
cy.setIndexPatternAsDataset(`${INDEX_WITH_TIME_1}*`, DATASOURCE_NAME);
cy.setQueryLanguage('Lucene');
cy.osd.setTopNavDate(START_TIME, END_TIME);

const query = `_id:N9srQ8opwBxGdIoQU3TW`;
cy.setQueryEditor(query);
cy.osd.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);

// Query should persist across refresh
cy.reload();
cy.verifyHitCount(1);
});

it('with SQL', () => {
cy.setIndexPatternAsDataset(`${INDEX_WITH_TIME_1}*`, DATASOURCE_NAME);
cy.setQueryLanguage('OpenSearch SQL');

// Default SQL query should be set
cy.osd.waitForLoader(true);
cy.getElementByTestId(`osdQueryEditor__multiLine`).contains(
`SELECT * FROM ${INDEX_WITH_TIME_1}* LIMIT 10`
);
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');

// Query should persist across refresh
cy.reload();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');

cy.getElementByTestId('osdQueryEditor__multiLine')
.find('.monaco-editor')
.should('be.visible')
// Ensure editor is in the correct visual state ('vs' is Monaco's default theme)
// This helps verify the editor is fully initialized and ready
.should('have.class', 'vs')
.click()
.find('textarea.inputarea')
.focus()
.type('{backspace}', { force: true });

cy.getElementByTestId(`querySubmitButton`).click();
cy.waitForSearch();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');
});

it('with PPL', () => {
cy.setIndexPatternAsDataset(`${INDEX_WITH_TIME_1}*`, DATASOURCE_NAME);
cy.setQueryLanguage('PPL');
cy.osd.setTopNavDate(START_TIME, END_TIME);

// Default PPL query should be set
cy.osd.waitForLoader(true);
cy.getElementByTestId(`osdQueryEditor__multiLine`).contains(
`source = ${INDEX_WITH_TIME_1}*`
);
cy.waitForSearch();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');

// Query should persist across refresh
cy.reload();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');
cy.verifyHitCount('10,000');
});
});
});
};

prepareTestSuite('Queries', queriesTestSuite);
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import {
INDEX_PATTERN_WITH_TIME,
INDEX_WITH_TIME_1,
INDEX_WITH_TIME_2,
DATASOURCE_NAME,
} from '../../../../../../utils/constants';
import {
generateAllTestConfigurations,
getRandomizedWorkspaceName,
setDatePickerDatesAndSearchIfRelevant,
} from '../../../../../../utils/apps/query_enhancements/shared';
import {
setSearchConfigurations,
verifyDiscoverPageState,
verifySavedSearchInAssetsPage,
updateSavedSearchAndSaveAndVerify,
generateSavedTestConfiguration,
postRequestSaveSearch,
} from '../../../../../../utils/apps/query_enhancements/saved';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

const runSavedSearchTests = () => {
describe('saved search', () => {
// TODO: Currently we cannot convert this into a "before" and "after" due to us grabbing several aliases that are required by postRequestSaveSearch()
beforeEach(() => {
cy.osd.setupWorkspaceAndDataSourceWithIndices(workspaceName, [
INDEX_WITH_TIME_1,
INDEX_WITH_TIME_2,
]);
cy.createWorkspaceIndexPatterns({
workspaceName: workspaceName,
indexPattern: INDEX_PATTERN_WITH_TIME.replace('*', ''),
timefieldName: 'timestamp',
dataSource: DATASOURCE_NAME,
isEnhancement: true,
});
cy.osd.grabDataSourceId(workspaceName, DATASOURCE_NAME);
});

afterEach(() => {
cy.osd.cleanupWorkspaceAndDataSourceAndIndices(workspaceName, [
INDEX_WITH_TIME_1,
INDEX_WITH_TIME_2,
]);
});

generateAllTestConfigurations(generateSavedTestConfiguration).forEach((config) => {
it(`create and load for ${config.testName}`, () => {
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
});

cy.setDataset(config.dataset, DATASOURCE_NAME, config.datasetType);

cy.setQueryLanguage(config.language);
setDatePickerDatesAndSearchIfRelevant(config.language);

setSearchConfigurations(config);
verifyDiscoverPageState(config);
cy.saveSearch(config.saveName);

// There is a small chance where if we go to assets page,
// the saved search does not appear. So adding this wait
cy.wait(2000);

verifySavedSearchInAssetsPage(config, workspaceName);

// load saved search
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
});

cy.getElementByTestId('discoverNewButton').click();
cy.setQueryLanguage(config.language);
cy.loadSaveSearch(config.saveName);
setDatePickerDatesAndSearchIfRelevant(config.language);
verifyDiscoverPageState(config);
});

it(`should successfully update a saved search for ${config.testName}`, () => {
// using a POST request to create a saved search to load
postRequestSaveSearch(config);
updateSavedSearchAndSaveAndVerify(config, workspaceName, DATASOURCE_NAME, false);
});

it(`should successfully save a saved search as a new saved search for ${config.testName}`, () => {
// using a POST request to create a saved search to load
postRequestSaveSearch(config);
updateSavedSearchAndSaveAndVerify(config, workspaceName, DATASOURCE_NAME, true);
});
});
});
};

prepareTestSuite('Saved Search', runSavedSearchTests);
Loading

0 comments on commit 1882311

Please sign in to comment.