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

[2.13] Switch to Private Tenant for Gantt Charts Tests #1195

Merged
merged 11 commits into from
Mar 29, 2024

Conversation

sejli
Copy link
Member

@sejli sejli commented Mar 29, 2024

Description

Duplicate of #1194 to attempt on 2.13 since OS is more stable.
Since #1187 was merged in while the failures were unresolved, opening this one to fix failures. Setting to draft initially so it doesn't get merged before finished again. Following #1033 example of setting tenants

Needs backport 2.x and backport main labels. Must go in after #1190 and #1191

Issues Resolved

#354

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.

Signed-off-by: Sean Li <[email protected]>
@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

Failed run here

gantt_ui.spec.js.mp4

@Hailong-am
Copy link
Collaborator

Hailong-am commented Mar 29, 2024

Failed run here

gantt_ui.spec.js.mp4

I think the issue is here
cy.contains(GANTT_VIS_NAME).click({ force: true }); the page have two places have GANTT_VIS_NAME, one is the search bar, another is the table list. we need specify the exactly the table row and click.

recommend change to

cy.get('[data-test-subj="itemsInMemTable"]').contains(GANTT_VIS_NAME).click({
    force: true,
  });

@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

Failed run here
gantt_ui.spec.js.mp4

I think the issue is here cy.contains(GANTT_VIS_NAME).click({ force: true }); the page have two places have GANTT_VIS_NAME, one is the search bar, another is the table list. we need specify the exactly the table row and click.

recommend change to

cy.get('[data-test-subj="itemsInMemTable"]').contains(GANTT_VIS_NAME).click({
    force: true,
  });

Nice catch, updated it in my latest commit. Both versions work on my local, might be some difference when running it in GitHub workflows.

@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

Hmm, looks like it failed again. In the video, it does look like it's being clicked on. Not sure why it fails here but on my local its fine.

gantt_ui.spec.js.mp4

@Hailong-am
Copy link
Collaborator

Hailong-am commented Mar 29, 2024

Hmm, looks like it failed again. In the video, it does look like it's being clicked on. Not sure why it fails here but on my local its fine.

gantt_ui.spec.js.mp4

could you try to add some delay after search and before click ?

@Hailong-am
Copy link
Collaborator

Hmm, looks like it failed again. In the video, it does look like it's being clicked on. Not sure why it fails here but on my local its fine.
gantt_ui.spec.js.mp4

could you try to add some delay after search and before click ?

I have tried to add a delay for 2s, The CI passed https://github.com/Hailong-am/opensearch-dashboards-functional-test/actions/runs/8476894095/job/23227047701?pr=2

https://github.com/Hailong-am/opensearch-dashboards-functional-test/pull/2/files

@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

I have tried to add a delay for 2s, The CI passed

Is it okay to add a cy.wait() here? I was under the impression that cy.wait() goes against testing best practices, and that we should avoid hardcoded waits as much as possible.

@Hailong-am
Copy link
Collaborator

Is it okay to add a cy.wait() here? I was under the impression that cy.wait() goes against testing best practices, and that we should avoid hardcoded waits as much as possible.

I think it's ok to use it, there have lots of cy.wait in our test.
For waiting for API to response, we recommend to use cy.intercept().as() combine with cy.wait().
But for page rendering, i think it's ok to use it.

Signed-off-by: Sean Li <[email protected]>
@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

Latest run failed on object not being saved. Looks like an error with saved objects

gantt_ui.spec.js.mp4

Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
@sejli sejli marked this pull request as ready for review March 29, 2024 06:44
@sejli sejli requested a review from raintygao as a code owner March 29, 2024 06:44
@Hailong-am Hailong-am merged commit e3105d6 into opensearch-project:2.13 Mar 29, 2024
35 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1195-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e3105d6a678dfe382b165263157d1226348e7734
# Push it to GitHub
git push --set-upstream origin backport/backport-1195-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1195-to-2.x.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 29, 2024
* trying on 2.13

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

* adding a should when searching for visualization

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

* specifying which row to click

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

* adding wait for request

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

* remove force click

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

* add hardcoded wait

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

* add another wait

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

* add default private tenant

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

* add kibana refresh

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

* uncommenting

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

* remove wait for request

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

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit e3105d6)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 29, 2024
* trying on 2.13

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

* adding a should when searching for visualization

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

* specifying which row to click

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

* adding wait for request

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

* remove force click

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

* add hardcoded wait

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

* add another wait

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

* add default private tenant

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

* add kibana refresh

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

* uncommenting

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

* remove wait for request

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

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit e3105d6)
SuZhou-Joe pushed a commit that referenced this pull request Apr 2, 2024
* trying on 2.13

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

* adding a should when searching for visualization

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

* specifying which row to click

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

* adding wait for request

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

* remove force click

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

* add hardcoded wait

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

* add another wait

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

* add default private tenant

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

* add kibana refresh

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

* uncommenting

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

* remove wait for request

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

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit e3105d6)

Co-authored-by: Sean Li <[email protected]>
Hailong-am pushed a commit that referenced this pull request Apr 18, 2024
* trying on 2.13

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

* adding a should when searching for visualization

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

* specifying which row to click

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

* adding wait for request

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

* remove force click

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

* add hardcoded wait

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

* add another wait

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

* add default private tenant

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

* add kibana refresh

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

* uncommenting

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

* remove wait for request

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

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit e3105d6)

Co-authored-by: Sean Li <[email protected]>
LDrago27 pushed a commit to LDrago27/opensearch-dashboards-functional-test that referenced this pull request May 3, 2024
…oject#1195) (opensearch-project#1196)

* trying on 2.13

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

* adding a should when searching for visualization

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

* specifying which row to click

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

* adding wait for request

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

* remove force click

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

* add hardcoded wait

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

* add another wait

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

* add default private tenant

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

* add kibana refresh

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

* uncommenting

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

* remove wait for request

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

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit e3105d6)

Co-authored-by: Sean Li <[email protected]>
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.

2 participants