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

fixed failed discover app shared links tests #1079

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Feb 7, 2024

  1. refactor so that each test case is independent from each other
  2. use decodeURI to make url consistent so that the url matches

Description

this PR fixed the 3 failed tests of cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js

  shared links
    shared links with state in query
      1) should allow for copying the snapshot URL
      ✓ should allow for copying the snapshot URL as a short URL
      2) should allow for copying the saved object URL
    shared links with state in sessionStorage
      ✓ should allow for copying the snapshot URL (12854ms)
      ✓ should allow for copying the snapshot URL as a short URL
      3) should allow for copying the saved object URL


  3 passing (4m)
  3 failing

  1) shared links
       shared links with state in query
         should allow for copying the snapshot URL:

      Timed out retrying after 60000ms
      + expected - actual

      -'http://localhost:5601/app/data-explorer/discover?security_tenant=global#/?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(indexPattern:\'logstash-*\',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:\'2015-09-19T04:31:44.000Z\',to:\'2015-09-23T16:31:44.000Z\'))&_q=(filters:!(),query:(language:kuery,query:\'\'))'
      +'http://localhost:5601/app/data-explorer/discover#/?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(indexPattern:\'logstash-*\',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:\'2015-09-19T13:31:44.000Z\',to:\'2015-09-24T01:31:44.000Z\'))&_q=(filters:!(),query:(language:kuery,query:\'\'))'
      
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js:187:84)

  2) shared links
       shared links with state in query
         should allow for copying the saved object URL:
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `[data-test-subj="savedObjectTitleA-Saved-Search"]`, but never found it.
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js:473:13)

  3) shared links
       shared links with state in sessionStorage
         should allow for copying the saved object URL:
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `[data-test-subj="savedObjectTitleA-Saved-Search"]`, but never found it.
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js:473:13)

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

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.

1. refactor so that each test case is indepent from each other
2. use decodeURI to make url consistent so that the url matches

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@ruanyl
Copy link
Member Author

ruanyl commented Feb 7, 2024

@abbyhu2000 would be nice if you could take a look :)

Copy link
Member

@abbyhu2000 abbyhu2000 left a comment

Choose a reason for hiding this comment

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

Thanks for improving the tests!

@ananzh ananzh merged commit 3a98fe6 into opensearch-project:main Feb 27, 2024
35 of 39 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-1079-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3a98fe6bd54d4d35e8f43110fe55c0d57dc1e873
# Push it to GitHub
git push --set-upstream origin backport/backport-1079-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-1079-to-2.x.

abbyhu2000 pushed a commit to abbyhu2000/opensearch-dashboards-functional-test that referenced this pull request Feb 27, 2024
1. refactor so that each test case is indepent from each other
2. use decodeURI to make url consistent so that the url matches

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@abbyhu2000
Copy link
Member

abbyhu2000 commented Feb 27, 2024

Needs to revert this PR because adding ?security_tenant=global in the URL will make the CI in dashboard fail since we run tests without enabling the security plugins.

Alternatively, we should skip the cypress tests when security is enabled:
#1120

abbyhu2000 added a commit to abbyhu2000/opensearch-dashboards-functional-test that referenced this pull request Feb 27, 2024
ananzh pushed a commit that referenced this pull request Feb 27, 2024
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.

4 participants