Skip to content

Commit

Permalink
Add cigroup matrix for parallel runs
Browse files Browse the repository at this point in the history
Signed-off-by: Manasvini B Suryanarayana <[email protected]>
  • Loading branch information
manasvinibs committed Feb 26, 2024
1 parent eefc531 commit 4022047
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/dashboards_cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Orchestrator cypress workflow
run-name: dashboards_cypress_workflow ${{ inputs.UNIQUE_ID != '' && inputs.UNIQUE_ID || '' }} # Unique id number appended to the workflow run-name to reference the run within the orchestrator.
# Trigger on dispatch event sent from FT repo orchestrator
on:
push:
branches: [ '**' ]
workflow_dispatch:
inputs:
test_repo:
Expand Down Expand Up @@ -43,20 +45,19 @@ env:
OSD_PATH: 'osd'
CYPRESS_BROWSER: 'chromium'
JOB_ID: ${{ inputs.UNIQUE_ID}}
OPENSEARCH: ${{ inputs.OS_URL != '' && inputs.OS_URL || 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/$VERSION/latest/linux/x64/tar/dist/opensearch/opensearch-$VERSION-linux-x64.tar.gz' }}
DASHBOARDS: ${{ inputs.OSD_URL != '' && inputs.OSD_URL || 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/$VERSION/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-$VERSION-linux-x64.tar.gz' }}
OPENSEARCH: ${{ inputs.OS_URL != '' && inputs.OS_URL || 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.12.0/latest/linux/x64/tar/dist/opensearch/opensearch-2.12.0-linux-x64.tar.gz' }}
DASHBOARDS: ${{ inputs.OSD_URL != '' && inputs.OSD_URL || 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.12.0/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-2.12.0-linux-x64.tar.gz' }}
OPENSEARCH_DIR: 'cypress/opensearch'
DASHBOARDS_DIR: 'cypress/opensearch-dashboards'
SECURITY_ENABLED: ${{ inputs.SECURITY_ENABLED != '' && inputs.SECURITY_ENABLED || 'false' }}
SPEC: 'cypress/integration/core_opensearch_dashboards/*'

jobs:
cypress-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
spec_group:
[1, 2, 3, 4] # Add more spec files as needed
spec_group: [1, 2] # Add more spec files as needed
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
Expand Down Expand Up @@ -94,10 +95,13 @@ jobs:
IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.spec_group }})
FORMATTED_SPEC=''
for i in "${SPEC_ARRAY[@]}"; do
echo "i is : ${i}"
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/${i},"
done
echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV
echo "SPec found: $SPEC"
SPEC=${FORMATTED_SPEC} # Set SPEC to FORMATTED_SPEC
echo "FORMATTED_SPEC: ${FORMATTED_SPEC}"
echo "SPEC=${SPEC}" >> $GITHUB_ENV
echo "SPecccc found: $SPEC"
- name: Get Cypress version
id: cypress_version
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@
"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",
"osd:ciGroup1": "echo \"\"",
"osd:ciGroup2": "echo \"\"",
"osd:ciGroup3": "echo \"\"",
"osd:ciGroup4": "echo \"dashboard_sanity_test_spec.js\""
"osd:ciGroup1": "echo \"dashboard_sanity_test_spec.js\"",
"osd:ciGroup2": "echo \"dashboard_sanity_test_spec.js\""
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 4022047

Please sign in to comment.