Skip to content
name: Cypress 12 experimental tests
on:
push:
branches: ['**']
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.lycheeignore'
- 'CODEOWNERS'
- 'changelogs/fragments/**'
env:
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first'
COMMENT_TAG: '[MANUAL CYPRESS TEST RUN RESULTS]'
COMMENT_SUCCESS_MSG: ':white_check_mark: Cypress test run succeeded!'
COMMENT_FAILURE_MSG: ':x: Cypress test run failed!'
LATEST_VERSION: '3.0.0'
COVERAGE: true
COMBINATIONS: |
[
[],
["SECURITY"],
["WORKSPACE", "DATA_SOURCE", "QUERY_ENHANCEMENTS", "USE_NEW_HOME_PAGE"]
]
jobs:
trigger-cypress-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Trigger tests for combinations
run: |
# Function to trigger workflow for a spec suite
trigger_workflow() {
local spec_path="$1"
local spec_name="$2"
local counter=1
echo "$COMBINATIONS" | jq -c '.[]' | while read -r combo; do
echo "Preparing tests for $spec_name with combination $counter: $combo"
# Prepare inputs for gh command
inputs="-f spec_pattern=$spec_path -f run_flag=${spec_name}:${counter}"
# Add variables to inputs
echo $combo | jq -r '.[]' | while read -r var; do
inputs="$inputs -f $var=true"
done
# Echo the inputs for verification
echo "Inputs for workflow dispatch: $inputs"
# Trigger the secondary workflow
#gh workflow run callable/run_cypress_tests.yml $inputs
# Increment counter
counter=$((counter + 1))
done
}
# Process spec files at the root
trigger_workflow "cypress/integration/*.spec.js" "root"
# Process spec folders
for folder in ./cypress/integration/*/; do
folder_name=$(basename "$folder")
trigger_workflow "cypress/integration/$folder_name/**/*.spec.js" "$folder_name"
done