From 2b49bffa4d3f3411980aa2f09f5d2f25947328d3 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Mon, 9 Dec 2024 17:18:33 +0100 Subject: [PATCH] update pipeline script --- .../pipelines/pull_request/pipeline.ts | 2 +- .../steps/functional/scout_ui_tests.sh | 48 ++++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index b94bb76f0ac41..217c29c00d9c6 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -383,7 +383,7 @@ const getPipeline = (filename: string, removeSteps = true) => { /^x-pack\/plugins\/discover_enhanced\/ui_tests/, /^packages\/kbn-scout/, ])) || - GITHUB_PR_LABELS.includes('ci:scout-tests') + GITHUB_PR_LABELS.includes('ci:scout-ui-tests') ) { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/scout_ui_tests.yml')); } diff --git a/.buildkite/scripts/steps/functional/scout_ui_tests.sh b/.buildkite/scripts/steps/functional/scout_ui_tests.sh index 85bf3c555f10f..06dddde65956c 100755 --- a/.buildkite/scripts/steps/functional/scout_ui_tests.sh +++ b/.buildkite/scripts/steps/functional/scout_ui_tests.sh @@ -6,26 +6,28 @@ source .buildkite/scripts/steps/functional/common.sh export JOB=kibana-scout-ui-tests -echo "--- Stateful: 'discover_enhanced' plugin UI Tests" -node scripts/scout run-tests \ - --stateful \ - --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" - -echo "--- Serverless Elasticsearch: 'discover_enhanced' plugin UI Tests" -node scripts/scout run-tests \ - --serverless=es \ - --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" - -echo "--- Serverless Observability: 'discover_enhanced' plugin UI Tests" -node scripts/scout run-tests \ - --serverless=oblt \ - --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" - -echo "--- Serverless Security: 'discover_enhanced' plugin UI Tests" -node scripts/scout run-tests \ - --serverless=security \ - --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts \ - --kibana-install-dir "$KIBANA_BUILD_LOCATION" +echo "--- Running 'discover_enhanced' plugin UI Tests" + +TEST_CONFIG="x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts" +KIBANA_DIR="$KIBANA_BUILD_LOCATION" + +declare -A TESTS=( + ["Stateful"]="--stateful" + ["Serverless Elasticsearch"]="--serverless=es" + ["Serverless Observability"]="--serverless=oblt" + ["Serverless Security"]="--serverless=security" +) + +EXIT_CODE=0 + +for TEST_NAME in "${!TESTS[@]}"; do + echo "--- $TEST_NAME: 'discover_enhanced' plugin UI Tests" + if ! node scripts/scout run-tests ${TESTS[$TEST_NAME]} --config "$TEST_CONFIG" --kibana-install-dir "$KIBANA_DIR"; then + echo "--- $TEST_NAME: failed" + EXIT_CODE=1 + else + echo "--- $TEST_NAME: passed" + fi +done + +exit $EXIT_CODE