Skip to content

Commit

Permalink
Add cypress ciGroup11 to github workflow for discover 2.0 tests
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Oct 22, 2024
1 parent 43fbef2 commit 244e1b5
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ env:
FTR_PATH: 'ftr'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
START_CMD_QUERY_ENHANCED: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=true --uiSettings.overrides['home:useNewHomePage']=true --workspace.enabled=true --data_source.enabled=true'
OPENSEARCH_SNAPSHOT_CMD_QUERY_ENHANCED: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false --sql'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
Expand All @@ -49,7 +51,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11]
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
Expand Down Expand Up @@ -117,7 +119,7 @@ jobs:
# Setup spec files for existing Functional Test repo cypress tests
- name: Setup spec files
if: ${{ inputs.specs == '' && matrix.group < 10 }}
if: ${{ inputs.specs == '' && matrix.group < 11 }}
working-directory: ${{ env.FTR_PATH }}
shell: bash
run: |
Expand All @@ -129,7 +131,7 @@ jobs:
echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV
- name: Get Cypress version
if: ${{ matrix.group < 10 }}
if: ${{ matrix.group < 11 }}
id: cypress_version
run: |
echo "name=cypress_version::$(cat ./${{ env.FTR_PATH }}/package.json | jq '.devDependencies.cypress' | tr -d '"')" >> $GITHUB_OUTPUT
Expand All @@ -148,7 +150,7 @@ jobs:

# Setup spec files for Dashboards in-house cypress tests
- name: Setup spec files for Dashboards tests
if: ${{ inputs.specs == '' && matrix.group > 9 }}
if: ${{ inputs.specs == '' && matrix.group > 10 }}
shell: bash
run: |
IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }})
Expand All @@ -167,15 +169,25 @@ jobs:
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}

# Run FT repo tests with query enhancements enabled
- name: Run FT repo tests with query enhancements enabled
if: ${{ matrix.group = 10 }}
uses: cypress-io/github-action@v2
with:
working-directory: ${{ env.FTR_PATH }}
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD_QUERY_ENHANCED }}, ${{ env.START_CMD_QUERY_ENHANCED }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}

# Clear Cypress Cache before running Dashboards tests
- name: Clear Cypress Cache
if: ${{ matrix.group > 9 }}
if: ${{ matrix.group > 10 }}
run: npx cypress cache clear

# Run Dashboards Cypress tests within the source repo
- name: Run Dashboards Cypress tests
if: ${{ matrix.group > 9 }}
if: ${{ matrix.group > 10 }}
uses: cypress-io/github-action@v6
with:
install-command: npx cypress install --force
Expand All @@ -186,30 +198,30 @@ jobs:
# Screenshots are only captured on failure, will change this once we do visual regression tests
- name: Upload FT repo screenshots
uses: actions/upload-artifact@v3
if: failure() && (matrix.group < 10)
if: failure() && (matrix.group < 11)
with:
name: ftr-cypress-screenshots
path: ${{ env.FTR_PATH }}/cypress/screenshots
retention-days: 1

- name: Upload FT repo videos
uses: actions/upload-artifact@v3
if: always() && (matrix.group < 10)
if: always() && (matrix.group < 11)
with:
name: ftr-cypress-videos
path: ${{ env.FTR_PATH }}/cypress/videos
retention-days: 1

- name: Upload FT repo results
uses: actions/upload-artifact@v3
if: always() && (matrix.group < 10)
if: always() && (matrix.group < 11)
with:
name: ftr-cypress-results
path: ${{ env.FTR_PATH }}/cypress/results
retention-days: 1

- name: Upload Dashboards screenshots
if: failure() && (matrix.group > 9)
if: failure() && (matrix.group > 10)
uses: actions/upload-artifact@v3
with:
name: dashboards-cypress-screenshots
Expand All @@ -218,15 +230,15 @@ jobs:

- name: Upload Dashboards repo videos
uses: actions/upload-artifact@v3
if: always() && (matrix.group > 9)
if: always() && (matrix.group > 10)
with:
name: dashboards-cypress-videos
path: cypress/videos
retention-days: 1

- name: Upload Dashboards repo results
uses: actions/upload-artifact@v3
if: always() && (matrix.group > 9)
if: always() && (matrix.group > 10)
with:
name: dashboards-cypress-results
path: cypress/results
Expand Down

0 comments on commit 244e1b5

Please sign in to comment.