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

Adds basic integration test for customImportMap plugin #272

Conversation

Shivamdhar
Copy link
Contributor

@Shivamdhar Shivamdhar commented Aug 4, 2022

Signed-off-by: Shivam Dhar [email protected]

Description

  • Checks if "Import Vector Map" tab is present (added to region map plugin via customImportMap)

Video without security ->

0_before.spec.js.mp4

Test results -

yarn cypress:run-without-security --spec "cypress/integration/plugins/customImportMap/*.js"

yarn run v1.22.18
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false --spec 'cypress/integration/plugins/customImportMap/*.js'
The experimentalNetworkStubbing configuration option was removed in Cypress version 6.0.0.

It is no longer necessary for using cy.intercept(). You can safely remove this option from your config.
Couldn't determine Mocha version

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v17.6.0 (/Users/dhshivam/.nvm/versions/node/v17.6.0/bin/node)                  │
  │ Specs:          1 found (plugins/customImportMap/0_before.spec.js)                             │
  │ Searched:       cypress/integration/plugins/customImportMap/*.js                               │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/customImportMap/0_before.spec.js                                        (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Couldn't determine Mocha version


  Before

    ✓ setup completed (36860ms)


  1 passing (37s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     36 seconds                                                                       │
  │ Spec Ran:     plugins/customImportMap/0_before.spec.js                                         │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/dhshivam/Documents/GitHub/opensearch-dashboards-func    (5 seconds)
                          tional-test/cypress/videos/plugins/customImportMap/0_before               
                          .spec.js.mp4                                                              


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/customImportMap/0_before.sp      00:36        1        1        -        -        - │
  │    ec.js                                                                                       │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:36        1        1        -        -        -  

✨  Done in 59.37s.

Video with security enabled ->

0_before.spec.js.mp4

Test results -

yarn cypress:run-with-security --spec "cypress/integration/plugins/customImportMap/*.js"

yarn run v1.22.18
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200 --spec 'cypress/integration/plugins/customImportMap/*.js'
The experimentalNetworkStubbing configuration option was removed in Cypress version 6.0.0.

It is no longer necessary for using cy.intercept(). You can safely remove this option from your config.
Couldn't determine Mocha version

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v17.6.0 (/Users/dhshivam/.nvm/versions/node/v17.6.0/bin/node)                  │
  │ Specs:          1 found (plugins/customImportMap/0_before.spec.js)                             │
  │ Searched:       cypress/integration/plugins/customImportMap/*.js                               │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/customImportMap/0_before.spec.js                                        (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Couldn't determine Mocha version


  Verify the presence of import custom map tab in region map plugin
    ✓ checks import custom map tab is present (74526ms)


  1 passing (1m)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 minute, 18 seconds                                                             │
  │ Spec Ran:     plugins/customImportMap/0_before.spec.js                                         │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/dhshivam/Documents/GitHub/opensearch-dashboards-func   (12 seconds)
                          tional-test/cypress/videos/plugins/customImportMap/0_before               
                          .spec.js.mp4                                                              

    Compression progress:  100%

====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/customImportMap/0_before.sp      01:18        1        1        -        -        - │
  │    ec.js                                                                                       │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        01:18        1        1        -        -        -  

✨  Done in 112.30s.

Issues Resolved

opensearch-project/dashboards-maps#26

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.

@Shivamdhar Shivamdhar requested a review from a team as a code owner August 4, 2022 06:48
@CCongWang
Copy link
Collaborator

Does it work in FGAC mode? Do tests pass if you run yarn cypress:run-with-security --spec "cypress/integration/plugins/customImportMap/*.js"?

@Shivamdhar Shivamdhar force-pushed the functional-test-customImportMap branch 2 times, most recently from e7761e8 to 35d90d7 Compare August 4, 2022 19:04
@Shivamdhar Shivamdhar requested a review from CCongWang August 4, 2022 19:05
@CCongWang CCongWang requested a review from tianleh August 4, 2022 19:08
@Shivamdhar Shivamdhar force-pushed the functional-test-customImportMap branch from 35d90d7 to f1b3fe1 Compare August 4, 2022 20:57
@CCongWang CCongWang merged commit b4a1f7a into opensearch-project:main Aug 4, 2022
@kavilla kavilla added backport 2.x v2.2.0 'Issues and PRs related to version v2.3.0' labels Aug 4, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 4, 2022
adds integration test for customImportMap plugin

Signed-off-by: Shivam Dhar <[email protected]>
(cherry picked from commit b4a1f7a)
CCongWang pushed a commit that referenced this pull request Aug 4, 2022
adds integration test for customImportMap plugin

Signed-off-by: Shivam Dhar <[email protected]>
(cherry picked from commit b4a1f7a)

Co-authored-by: Shivam Dhar <[email protected]>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.2 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.2 2.2
# Navigate to the new working tree
cd .worktrees/backport-2.2
# Create a new branch
git switch --create backport/backport-272-to-2.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b4a1f7a1cba7514eccb91a1cc5df807de5d214de
# Push it to GitHub
git push --set-upstream origin backport/backport-272-to-2.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.2

Then, create a pull request where the base branch is 2.2 and the compare/head branch is backport/backport-272-to-2.2.

CCongWang pushed a commit that referenced this pull request Feb 10, 2023
adds integration test for customImportMap plugin

Signed-off-by: Shivam Dhar <[email protected]>
(cherry picked from commit b4a1f7a)

Co-authored-by: Shivam Dhar <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
jakubp-eliatra pushed a commit to sebastianmichalski/opensearch-dashboards-functional-test that referenced this pull request Mar 24, 2023
)

adds integration test for customImportMap plugin

Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Jakub Przybylski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.2 v2.2.0 'Issues and PRs related to version v2.3.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants