Skip to content

Commit

Permalink
reverted workflow
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Feb 21, 2025
1 parent 17f7e6a commit 5a71721
Showing 1 changed file with 9 additions and 45 deletions.
54 changes: 9 additions & 45 deletions .github/workflows/release-e2e-workflow-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
test-command:
required: true
type: string
osd-serve-args:
required: false
type: string
security-enabled:
required: false
type: string
jobs:
tests:
name: Run Cypress E2E tests for ${{ inputs.test-name }}
Expand All @@ -37,39 +31,21 @@ jobs:
working-directory: cypress-test
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get security setups
run: |
SECURITY_ENABLED=${{ inputs.security-enabled }}
if [ "$SECURITY_ENABLED" != 'false' ]; then
echo "SECURITY_ENABLED=true" >> $GITHUB_ENV
else
echo "SECURITY_ENABLED=false" >> $GITHUB_ENV
fi
- name: Get and run OpenSearch
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
cd opensearch-${{ env.VERSION }}/
if [ "$SECURITY_ENABLED" = 'false' ]; then
echo "Remove OpenSearch Security"
[ -d "plugins/opensearch-security" ] && echo "plugins.security.disabled: true" >> config/opensearch.yml
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' http://localhost:9200)" != "200" ]]; do sleep 5; done'
curl http://localhost:9200
else
echo "Keep OpenSearch Security"
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
curl https://localhost:9200 -u admin:admin --insecure
fi
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
- name: Get OpenSearch-Dashboards
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
- 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]")"
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -78,20 +54,8 @@ jobs:
- name: Run OpenSearch-Dashboards server
run: |
cd opensearch-dashboards-${{ env.VERSION }}
if [ "$SECURITY_ENABLED" = 'false' ]; then
echo "Remove Dashboards Security"
./bin/opensearch-dashboards-plugin remove securityDashboards
sed -i /^opensearch_security/d config/opensearch_dashboards.yml
sed -i 's/https/http/' config/opensearch_dashboards.yml
bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} &
timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
curl http://localhost:5601/api/status
else
echo "Keep Dashboards Security"
bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} &
timeout 300 bash -c 'while [[ "$(curl -u admin:admin -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
curl http://localhost:5601/api/status -u admin:admin --insecure
fi
bin/opensearch-dashboards serve &
timeout 300 bash -c 'while [[ "$(curl -s -u admin:admin -k localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
- name: Get Cypress version
id: cypress_version
run: |
Expand All @@ -113,20 +77,20 @@ jobs:
command: ${{ inputs.test-command }}
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: cypress-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v1
if: always()
with:
name: cypress-videos
path: cypress-test/cypress/videos
# Test reports was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v1
if: always()
with:
name: cypress-results
path: cypress-test/cypress/results
path: cypress-test/cypress/results

0 comments on commit 5a71721

Please sign in to comment.