Skip to content

Commit

Permalink
Backport changes to 1.3 in opensearch-project#676 (opensearch-project…
Browse files Browse the repository at this point in the history
…#687)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored May 26, 2023
1 parent 963123d commit 860d1bb
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 40 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/cypress-workflow-vanilla-snapshot-based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
branches:
- main
- dev-*
env:
VERSION: '1.3.0'
jobs:
tests:
name: Run Cypress E2E tests
Expand All @@ -24,40 +22,41 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 14
- name: Checkout monetery-test
uses: actions/checkout@v2
with:
repository: ${{github.repository}}
path: monetery-test
# TODO: Qualifier not supported yet for OSD snapshot
# - name: Get package version
# working-directory: monetery-test
# run: |
# echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get package version
working-directory: monetery-test
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get and run OpenSearch
run: |
wget https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.VERSION }}-SNAPSHOT/opensearch-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz
tar -xzf opensearch-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz
cd opensearch-${{ env.VERSION }}-SNAPSHOT/
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-min-${{ env.VERSION }}-linux-x64.tar.gz
cd opensearch-${{ env.VERSION }}/
bin/opensearch &
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
- name: Get OpenSearch-Dashboards
run: |
wget https://artifacts.opensearch.org/snapshots/core/opensearch-dashboards/${{ env.VERSION }}-SNAPSHOT/opensearch-dashboards-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz
tar -xzf opensearch-dashboards-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-SNAPSHOT-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/builds/opensearch-dashboards/dist/opensearch-dashboards-min-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-dashboards-min-${{ env.VERSION }}-linux-x64.tar.gz
- name: Run OpenSearch-Dashboards server
run: |
cd opensearch-dashboards-${{ env.VERSION }}-SNAPSHOT-linux-x64
cd opensearch-dashboards-${{ env.VERSION }}-linux-x64
bin/opensearch-dashboards serve &
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
- name: Checkout Monterey test cases
uses: actions/checkout@v2
with:
repository: ${{github.repository}}
path: monetery-test
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./monetery-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand All @@ -72,7 +71,7 @@ jobs:
uses: cypress-io/github-action@v2
with:
working-directory: monetery-test
command: yarn cypress:run-without-security --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
command: yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-signoff-chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-signoff-chromium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-signoff-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-signoff-firefox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -47,7 +48,8 @@ jobs:
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
Expand Down

0 comments on commit 860d1bb

Please sign in to comment.