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

Run Cypress integration tests on build #143

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

msfroh
Copy link
Collaborator

@msfroh msfroh commented Jan 24, 2023

Run the Cypress integration tests as a GitHub action on every build, to better catch regressions.

Signed-off-by: Michael Froh froh@amazon.com

Description

Run the Cypress integration tests as a GitHub action on every build, to better catch regressions.

Issues Resolved

#119 - Add integration test to git actions

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.

@msfroh msfroh requested a review from a team January 24, 2023 00:16
@msfroh msfroh force-pushed the run-integ-tests-on-build branch 2 times, most recently from 21c946b to adb7001 Compare January 24, 2023 05:28
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2023

Codecov Report

Merging #143 (38fa47e) into main (534983f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #143   +/-   ##
=======================================
  Coverage   81.42%   81.42%           
=======================================
  Files          13       13           
  Lines         140      140           
  Branches       27       27           
=======================================
  Hits          114      114           
  Misses         24       24           
  Partials        2        2           
Flag Coverage Δ
dashboards-search-relevance 81.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@msfroh msfroh force-pushed the run-integ-tests-on-build branch 3 times, most recently from a0a2beb to 712de0e Compare January 24, 2023 17:24
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_VERSION: '3.0.0-SNAPSHOT'
Copy link
Collaborator

Choose a reason for hiding this comment

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

may I ask why it's running in opensearch_version, 3.0.0 snapshot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right -- this is for the main branch. We'll go with 2.5 on the 2.x branch.

@msfroh msfroh force-pushed the run-integ-tests-on-build branch 3 times, most recently from 112035d to 2033e05 Compare January 25, 2023 01:17
@noCharger
Copy link
Collaborator

@msfroh Great progress!

Can we fix the timeout in git actions

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


  Compare queries
    1) "before all" hook for "Should get comparison results"
    2) "after all" hook for "Should get comparison results"


  0 passing (1m)
  2 failing

  1) Compare queries
       "before all" hook for "Should get comparison results":
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `button[data-test-subj="addSampleDataSetecommerce"]`, but never found it.

Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `Compare queries`
      at MiscUtils.addSampleData (http://localhost:5601/__cypress/tests?p=cypress/integration/plugins/search-relevance-dashboards/1_query_compare.spec.js:530:79)
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/plugins/search-relevance-dashboards/1_query_compare.spec.js:113:15)

  2) Compare queries
       "after all" hook for "Should get comparison results":
     CypressError: You attempted to make a chai-jQuery assertion on an object that is neither a DOM object or a jQuery object.

Comment on lines 43 to 63
# It doesn't matter what plugin we use, but by launching OpenSearch
# from a plugin repo, we don't need to checkout and build
# OpenSearch itself.
- name: Checkout Anomaly-Detection
uses: actions/checkout@v2
with:
path: anomaly-detection
repository: opensearch-project/anomaly-detection
ref: ${{ env.ANOMALY_DETECTION_PLUGIN_VERSION }}

- name: Run OpenSearch with plugin
run: |
cd anomaly-detection
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
bash -c 't=0; while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; let t=$t+5; if [[ $t -gt 300 ]]; then exit 1; fi; done'
shell: bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update the path of anomaly-detection and get the OpenSearch installed

Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
Copy link
Collaborator

@noCharger noCharger left a comment

Choose a reason for hiding this comment

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

This is awesome!

@msfroh msfroh merged commit 2ef265d into opensearch-project:main Mar 7, 2023
@github-actions
Copy link

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
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport-143-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2ef265d54536089c9749bea42e499fafc5a03804
# Push it to GitHub
git push --set-upstream origin backport-143-to-2.x
# Go back to the original working tree
popd
# 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-143-to-2.x.

noCharger pushed a commit that referenced this pull request May 25, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
noCharger pushed a commit that referenced this pull request May 25, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)

Signed-off-by: Louis Chu <clingzhi@amazon.com>
noCharger pushed a commit that referenced this pull request May 25, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
noCharger pushed a commit that referenced this pull request May 25, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
noCharger pushed a commit that referenced this pull request May 26, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
@github-actions
Copy link

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

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

noCharger added a commit that referenced this pull request May 26, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)

Co-authored-by: Michael Froh <froh@amazon.com>
noCharger pushed a commit that referenced this pull request May 26, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
noCharger pushed a commit that referenced this pull request May 26, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)
noCharger added a commit that referenced this pull request May 27, 2023
Run the Cypress integration tests as a GitHub action on every build,
to better catch regressions.

Signed-off-by: Michael Froh <froh@amazon.com>
(cherry picked from commit 2ef265d)

Co-authored-by: Michael Froh <froh@amazon.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.

4 participants