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 27, 2024
1 parent eefc531 commit d14482a
Showing 3 changed files with 16 additions and 11 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/dashboards_cypress_workflow.yml
Original file line number Diff line number Diff line change
@@ -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:
@@ -48,15 +50,14 @@ env:
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
@@ -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
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/${i},"
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
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
5 changes: 4 additions & 1 deletion scripts/cypress_tests.sh
Original file line number Diff line number Diff line change
@@ -67,10 +67,12 @@ function check_status() {

# Starts OpenSearch Dashboards and run tests in the cypress folder
function run_dashboards_cypress_tests() {
run_opensearch
cd $CWD
echo "[ OpenSearch Dashboards setup before it starts... ]"
setup_dashboards >> /dev/null 2>&1 &
sleep 100
cd "$DASHBOARDS_DIR"
cd $CWD/"$DASHBOARDS_DIR"
if [ -x "./bin/opensearch-dashboards" ]; then
spawn_process_and_save_PID "./bin/opensearch-dashboards &"
else
@@ -85,6 +87,7 @@ function run_dashboards_cypress_tests() {
function run_cypress() {
cd "$CWD"/osd
echo "SPEC found: $SPEC"
ls -l
if [ $SECURITY_ENABLED = "true" ]; then
echo "run security enabled tests"
yarn cypress:run-with-security --browser $CYPRESS_BROWSER --spec $SPEC

0 comments on commit d14482a

Please sign in to comment.