From 8eea9f408b9fdfbd1827f1704b912575df5978a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 13 Oct 2023 23:01:19 +0000 Subject: [PATCH] [CI] Cypress tests support ciGroups (#5298) Partially resolves: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5297 Add ciGroups to handle the increase in tests added which also impact the allocation available on the machines that run these tests. However, this deserves to be more optimized and utilized within the build infra repo so that we can ensure that release testing is also leverging ciGroups within plugins. Signed-off-by: Kawika Avilla (cherry picked from commit 7a964b61653296cf607ae50bc6dd5eb64b19e52f) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md --- .github/workflows/cypress_workflow.yml | 45 ++++++++++++++++++-------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml index b61b9d64c6bb..90bacdbefb57 100644 --- a/.github/workflows/cypress_workflow.yml +++ b/.github/workflows/cypress_workflow.yml @@ -9,31 +9,29 @@ on: workflow_dispatch: inputs: test_repo: - description: 'Test repo' + description: 'Cypress test repo' default: 'opensearch-project/opensearch-dashboards-functional-test' required: true type: string test_branch: - description: 'Test branch (default: source branch)' + description: 'Cypress test branch (default: source branch)' required: false type: string - pr_number: - description: 'PR Number' - required: false - type: number specs: - description: 'Tests to run (default: core)' - default: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' + description: 'Tests to run (default: osd:ciGroup)' required: false type: string + pr_number: + description: 'PR Number (optional)' + required: false + type: number env: TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }} TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}" FTR_PATH: 'ftr' - START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch' + 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' OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false' - SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }} CYPRESS_BROWSER: 'chromium' CYPRESS_VISBUILDER_ENABLED: true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false @@ -46,6 +44,10 @@ env: jobs: cypress-tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + group: [1, 2, 3, 4, 5, 6, 7, 8, 9] container: image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 options: --user 1001 @@ -54,7 +56,7 @@ jobs: CI: 1 # avoid warnings like "tput: No value for $TERM and no -T specified" TERM: xterm - name: Run cypress tests + name: Run cypress tests (osd:ciGroup${{ matrix.group }}) steps: - name: Get source information from PR number if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} @@ -97,7 +99,7 @@ jobs: run: yarn osd bootstrap - name: Build plugins - run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 + run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12 - name: Checkout uses: actions/checkout@v2 @@ -106,6 +108,23 @@ jobs: repository: ${{ env.TEST_REPO }} ref: '${{ env.TEST_BRANCH }}' + - name: Setup spec files by input + if: ${{ inputs.specs != '' }} + run: | + echo "SPEC=${{ inputs.specs }}" >> $GITHUB_ENV + + - name: Setup spec files + if: ${{ inputs.specs == '' }} + working-directory: ${{ env.FTR_PATH }} + shell: bash + run: | + IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }}) + FORMATTED_SPEC='' + for i in "${SPEC_ARRAY[@]}"; do + FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i}," + done + echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV + - name: Get Cypress version id: cypress_version run: | @@ -179,8 +198,6 @@ jobs: #### Inputs: ``` - Source repo: '${{ env.SOURCE_REPO }}' - Source branch: '${{ env.SOURCE_BRANCH }}' Test repo: '${{ env.TEST_REPO }}' Test branch: '${{ env.TEST_BRANCH }}'