diff --git a/.github/workflows/dashboards_cypress_workflow.yml b/.github/workflows/dashboards_cypress_workflow.yml index ce578970b477..7f0a6bb9c3d7 100644 --- a/.github/workflows/dashboards_cypress_workflow.yml +++ b/.github/workflows/dashboards_cypress_workflow.yml @@ -53,6 +53,10 @@ env: jobs: cypress-tests: runs-on: ubuntu-latest + strategy: + matrix: + spec_group: + [1, 2, 3, 4] # Add more spec files as needed container: image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 options: --user 1001 @@ -61,7 +65,7 @@ jobs: CI: 1 # avoid warnings like "tput: No value for $TERM and no -T specified" TERM: xterm - name: Run cypress tests ${{ inputs.UNIQUE_ID}} + name: Run cypress tests (osd:ciGroup${{ matrix.spec_group }}) ${{ inputs.UNIQUE_ID}} steps: - name: Checkout code uses: actions/checkout@v2 @@ -82,6 +86,19 @@ jobs: npm i -g yarn@1.22.10 yarn config set network-timeout 1000000 -g + - name: Setup spec files + if: ${{ inputs.specs == '' }} + working-directory: ${{ env.OSD_PATH }} + shell: bash + run: | + IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.spec_group }}) + FORMATTED_SPEC='' + for i in "${SPEC_ARRAY[@]}"; do + FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/${i}," + done + echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV + echo "SPec found: $SPEC" + - name: Get Cypress version id: cypress_version run: | diff --git a/package.json b/package.json index cb24289e686f..2e0fc44391e2 100644 --- a/package.json +++ b/package.json @@ -79,8 +79,11 @@ "spec_to_console": "scripts/use_node scripts/spec_to_console", "pkg-version": "scripts/use_node -e \"console.log(require('./package.json').version)\"", "cypress:run-without-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false", - "cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500" - + "cypress:run-with-security": "env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500", + "osd:ciGroup1": "echo \"\"", + "osd:ciGroup2": "echo \"\"", + "osd:ciGroup3": "echo \"\"", + "osd:ciGroup4": "echo \"dashboard_sanity_test_spec.js\"" }, "repository": { "type": "git",