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

Cypress tests for data explorer #862

Merged
merged 34 commits into from
Oct 13, 2023

Conversation

abbyhu2000
Copy link
Member

@abbyhu2000 abbyhu2000 commented Sep 15, 2023

Description

This PR migrates the old selenium tests for discover to cypress tests for data explorer.
PR for #5003 needs to be merged first.

Below are a list of bugs found when writing the tests, the tests for the below feature are skipped and commented with the issue link:

Issues Resolved

resolves opensearch-project/OpenSearch-Dashboards#4781

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

cypress.json Outdated Show resolved Hide resolved
@@ -0,0 +1,95 @@
{
"type": "doc",
Copy link
Member

Choose a reason for hiding this comment

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

can some of this be zipped up?

@kavilla
Copy link
Member

kavilla commented Sep 19, 2023

AWESOME! Will verify later this week. Made some quick comments we should also verify with security enabled. Targetting 2.11?

@abbyhu2000
Copy link
Member Author

AWESOME! Will verify later this week. Made some quick comments we should also verify with security enabled. Targetting 2.11?

yea i think it is targeting 2.11 @ashwin-pc

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Firstly, really good job with the PR. The tests look good and well written. Im partway though the review by have a general question about cleanup. You are adding a lot of fixtures and changing settings. @kavilla Do you think we need to remove the fixtures after each test/test suite?

cypress/utils/dashboards/data_explorer/constants.js Outdated Show resolved Hide resolved
cypress/utils/dashboards/data_explorer/commands.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@kavilla
Copy link
Member

kavilla commented Sep 25, 2023

You are adding a lot of fixtures and changing settings. @kavilla Do you think we need to remove the fixtures after each test/test suite?

@ashwin-pc that's a good point, the selenium tests would check if load an add them if needed where as some plugins really rely on a fresh state.

Perhaps instead of creating a helper function to check and optimize it can be apart of the cypress env variables where it defaults deletes these values after each spec. and we can configure it from our CI to not delete per spec.

Another work around (which isn't a catchall) but we ensure the complete uniqueness of the data index created.

@ashwin-pc
Copy link
Member

P.S. Dont merge this until feature/deangular is merged into main for OSD.

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

@abbyhu2000 can you add the recordings for these tests to the PR?

@ashwin-pc
Copy link
Member

@kavilla hmm, that seems like that can come as a followup. Want to put some more thought into that. I'm okay with this going in as is for now and following up with improvements to test improvements later when we have a better solution for cleanup.

@kavilla
Copy link
Member

kavilla commented Sep 28, 2023

@abbyhu2000 @ashwin-pc I think maybe we should consider optimizing the uploading data. Or we start building in the ciGroup stuff since I see this PR increasing the time of the test run:

opensearch-project/OpenSearch-Dashboards#5134 (comment).

I thought it was failing but I believe it was working just fine just taking a while. (Sorry about the format, i have another PR to fix the formatting issue)

@abbyhu2000
Copy link
Member Author

Wrote a function importJSONDocIfNeeded to optimize uploading data, it will save time if the indices are already loaded in a previous test.

@abbyhu2000 abbyhu2000 force-pushed the discover_app branch 3 times, most recently from d63f76d to 17b8d61 Compare October 4, 2023 21:04
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
abbyhu2000 and others added 2 commits October 11, 2023 17:25
Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@abbyhu2000
Copy link
Member Author

@kavilla kavilla merged commit 7cf0a03 into opensearch-project:main Oct 13, 2023
33 of 38 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 13, 2023
Migrate the old selenium tests for discover to cypress tests for data explorer.
PR [for #5003](opensearch-project/OpenSearch-Dashboards#5072) needs to be merged first.

Below are a list of bugs found when writing the tests, the tests for the below feature are skipped and commented with the issue link:

- opensearch-project/OpenSearch-Dashboards#5071
- opensearch-project/OpenSearch-Dashboards#5068
- opensearch-project/OpenSearch-Dashboards#5058
- opensearch-project/OpenSearch-Dashboards#5057
- opensearch-project/OpenSearch-Dashboards#5056

### Issues Resolved
resolves opensearch-project/OpenSearch-Dashboards#4781

---------

Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
(cherry picked from commit 7cf0a03)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 13, 2023
Migrate the old selenium tests for discover to cypress tests for data explorer.
PR [for #5003](opensearch-project/OpenSearch-Dashboards#5072) needs to be merged first.

Below are a list of bugs found when writing the tests, the tests for the below feature are skipped and commented with the issue link:

- opensearch-project/OpenSearch-Dashboards#5071
- opensearch-project/OpenSearch-Dashboards#5068
- opensearch-project/OpenSearch-Dashboards#5058
- opensearch-project/OpenSearch-Dashboards#5057
- opensearch-project/OpenSearch-Dashboards#5056

### Issues Resolved
resolves opensearch-project/OpenSearch-Dashboards#4781

---------

Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
(cherry picked from commit 7cf0a03)
kavilla pushed a commit that referenced this pull request Oct 13, 2023
Migrate the old selenium tests for discover to cypress tests for data explorer.
PR [for #5003](opensearch-project/OpenSearch-Dashboards#5072) needs to be merged first.

Below are a list of bugs found when writing the tests, the tests for the below feature are skipped and commented with the issue link:

- opensearch-project/OpenSearch-Dashboards#5071
- opensearch-project/OpenSearch-Dashboards#5068
- opensearch-project/OpenSearch-Dashboards#5058
- opensearch-project/OpenSearch-Dashboards#5057
- opensearch-project/OpenSearch-Dashboards#5056

### Issues Resolved
resolves opensearch-project/OpenSearch-Dashboards#4781

---------

Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
(cherry picked from commit 7cf0a03)

Co-authored-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
kavilla pushed a commit that referenced this pull request Oct 13, 2023
Migrate the old selenium tests for discover to cypress tests for data explorer.
PR [for #5003](opensearch-project/OpenSearch-Dashboards#5072) needs to be merged first.

Below are a list of bugs found when writing the tests, the tests for the below feature are skipped and commented with the issue link:

- opensearch-project/OpenSearch-Dashboards#5071
- opensearch-project/OpenSearch-Dashboards#5068
- opensearch-project/OpenSearch-Dashboards#5058
- opensearch-project/OpenSearch-Dashboards#5057
- opensearch-project/OpenSearch-Dashboards#5056

### Issues Resolved
resolves opensearch-project/OpenSearch-Dashboards#4781

---------

Signed-off-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
(cherry picked from commit 7cf0a03)

Co-authored-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Data Explorer] Write new cypress functional tests for discover 2.0
4 participants