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 workflow improvements #560

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Jul 19, 2023

Description

This PR has 2 improvements:

  1. Update glob to include subdirectories. Test specs have been added under vis_augmenter subdirectory as part of this PR and are currently not running in this workflow.
  2. Remove env vars to just fetch the same branch that the workflow is running from. For example, in main, this will fetch main branches of all the repos. This follows what is done in OSD repo. It also helps prevent conflicts and lessens the differences between main/2.x.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
  • 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: Tyler Ohlsen <ohltyler@amazon.com>
@ohltyler ohltyler added test Adding or fixing tests backport 2.x v2.10.0 labels Jul 19, 2023
@opensearch-trigger-bot opensearch-trigger-bot bot added the github actions Updating or adding GitHub actions label Jul 19, 2023
@ohltyler
Copy link
Member Author

CI will fail to run 3.0 cluster. Confirmed on my local this runs all 11 test suites (8 existing + 3 new under vis_augmenter)

ohltyler@b0f1d86ddbb0 opensearch-dashboards-functional-test % yarn cypress:run-without-security --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/**/*'
yarn run v1.22.19
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/**/*'
Couldn't determine Mocha version

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v14.20.0 (/Users/ohltyler/.nvm/versions/node/v14.20.0/bin/node)                │
  │ Specs:          11 found (plugins/anomaly-detection-dashboards-plugin/create_detector_spec.js, │
  │                  plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js, plugins/anomal │
  │                 y-detection-dashboards-plugin/detector_configuration_spec.js, plugins/anomaly- │
  │                 detection-dashboards-pl...)                                                    │
  │ Searched:       cypress/integration/plugins/anomaly-detection-dashboards-plugin/**/*           │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #560 (d94c675) into main (3863e46) will not change coverage.
The diff coverage is n/a.

❗ Current head d94c675 differs from pull request most recent head 7b77d52. Consider uploading reports for the commit 7b77d52 to get more accurate results

@@           Coverage Diff           @@
##             main     #560   +/-   ##
=======================================
  Coverage   50.25%   50.25%           
=======================================
  Files         166      166           
  Lines        5593     5593           
  Branches     1055     1055           
=======================================
  Hits         2811     2811           
  Misses       2511     2511           
  Partials      271      271           

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@ohltyler ohltyler changed the title Update cypress test cmd to include vis augmenter tests Cypress workflow improvements Jul 19, 2023
@@ -132,6 +128,6 @@ jobs:
uses: cypress-io/github-action@v2
with:
working-directory: opensearch-dashboards-functional-test
command: yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/*.js
command: yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/**/*.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this skip existing specs like create_detector_spec.js as you only execute specs under anomaly-detection-dashboards-plugin's subdirectories?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, they will be included along with any subdirectories - you can see that in the list of found specs in comment above

Copy link
Collaborator

Choose a reason for hiding this comment

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

Your command in the comment has no .js:

yarn cypress:run-without-security --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/**/*

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirmed it still shows 11 w/ command:

  │ Specs:          11 found (plugins/anomaly-detection-dashboards-plugin/create_detector_spec.js, │
  │                  plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js, plugins/anomal │
  │                 y-detection-dashboards-plugin/detector_configuration_spec.js, plugins/anomaly- │
  │                 detection-dashboards-pl...)   

@ohltyler
Copy link
Member Author

@amitgalitz can you look into the test failures? Looks related to associated detectors page.

@ohltyler ohltyler merged commit 53677c5 into opensearch-project:main Jul 21, 2023
4 of 9 checks passed
@ohltyler ohltyler deleted the add-vis-augmenter-tests branch July 21, 2023 23:48
@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-560-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 53677c54a8df8e2e77a5cb34f98acd5e7c202ab9
# Push it to GitHub
git push --set-upstream origin backport/backport-560-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-560-to-2.x.

ohltyler added a commit to ohltyler/anomaly-detection-dashboards-plugin-1 that referenced this pull request Jul 21, 2023
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
ohltyler added a commit that referenced this pull request Jul 24, 2023
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x github actions Updating or adding GitHub actions test Adding or fixing tests v2.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants