From 34c8e9238cd2c794115f0c48b8696d261153f6ad Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 14 Apr 2026 12:57:02 +0200 Subject: [PATCH 1/3] [scout] skip api tests for no changes, build plugins --- .../steps/test/scout/test_run_builder.sh | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.buildkite/scripts/steps/test/scout/test_run_builder.sh b/.buildkite/scripts/steps/test/scout/test_run_builder.sh index 8555d9c8e28d0..5b1cda375d16c 100755 --- a/.buildkite/scripts/steps/test/scout/test_run_builder.sh +++ b/.buildkite/scripts/steps/test/scout/test_run_builder.sh @@ -92,12 +92,29 @@ else buildkite-agent artifact upload "scout_playwright_configs.json" fi -echo '--- Running Scout API Integration Tests (against Kibana source code)' -node scripts/scout.js run-tests \ - --location local \ - --arch stateful \ - --domain classic \ - --config src/platform/packages/shared/kbn-scout/test/scout/api/parallel.playwright.config.ts \ +RUN_SCOUT_API_TESTS=true + +if [[ -n "${AFFECTED_MODULES_FILE:-}" ]] && [[ -f "${AFFECTED_MODULES_FILE}" ]]; then + AFFECTED_MODULE_COUNT=$(node -e "console.log(JSON.parse(require('fs').readFileSync(process.env.AFFECTED_MODULES_FILE,'utf8')).length)") + if [[ "$AFFECTED_MODULE_COUNT" == "0" ]] && [[ "${SCOUT_CRITICAL_FILES_TOUCHED:-false}" != "true" ]]; then + RUN_SCOUT_API_TESTS=false + echo "Skipping Scout API Integration Tests: 0 affected modules and no critical files touched" + else + echo "Running Scout API Integration Tests: ${AFFECTED_MODULE_COUNT} affected module(s), critical files touched: ${SCOUT_CRITICAL_FILES_TOUCHED:-false}" + fi +fi + +if [[ "$RUN_SCOUT_API_TESTS" == "true" ]]; then + echo '--- Build Kibana platform plugins' + node scripts/build_kibana_platform_plugins.js + + echo '--- Running Scout API Integration Tests (against Kibana source code)' + node scripts/scout.js run-tests \ + --location local \ + --arch stateful \ + --domain classic \ + --config src/platform/packages/shared/kbn-scout/test/scout/api/parallel.playwright.config.ts +fi source .buildkite/scripts/steps/test/scout/upload_report_events.sh From 6375bd1e490b4eee50b7af8296a11017539a7572 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 14 Apr 2026 13:33:45 +0200 Subject: [PATCH 2/3] run internal tests with other, update logs --- .buildkite/scout_ci_config.yml | 5 +--- .../steps/test/scout/test_run_builder.sh | 27 ++----------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/.buildkite/scout_ci_config.yml b/.buildkite/scout_ci_config.yml index 398c029f632ca..da2f295ed8e7c 100644 --- a/.buildkite/scout_ci_config.yml +++ b/.buildkite/scout_ci_config.yml @@ -54,12 +54,9 @@ plugins: packages: enabled: + - kbn-scout - kbn-streamlang-tests disabled: - # Scout's own tests are executed first to validate the Scout framework - # (see .buildkite/scripts/steps/test/scout/test_run_builder.sh). Excluded here - # so they don't rerun alongside plugin/package Scout tests discovered later. - - kbn-scout - kbn-scout-release-testing # Release tests will run separately as part of the release process # Define test configs to be excluded from automatic discovery & execution in CI environment (process.env.CI=true) diff --git a/.buildkite/scripts/steps/test/scout/test_run_builder.sh b/.buildkite/scripts/steps/test/scout/test_run_builder.sh index 5b1cda375d16c..1a5ea44d9b497 100755 --- a/.buildkite/scripts/steps/test/scout/test_run_builder.sh +++ b/.buildkite/scripts/steps/test/scout/test_run_builder.sh @@ -80,7 +80,8 @@ else SELECTIVE_SCOUT_DISCOVERY_FLAG=(--selective-testing) echo "Selective testing: enabled (--selective-testing flag will be passed to discover-playwright-configs)" else - echo "Selective testing: disabled — reason: SELECTIVE_TESTING_ENABLED=${SELECTIVE_TESTING_ENABLED:-false}, scout:run-all-tests label=$(is_pr_with_label "scout:run-all-tests" && echo yes || echo no), critical files touched=${SCOUT_CRITICAL_FILES_TOUCHED}" + echo "Selective testing is disabled" + echo "Reason: SELECTIVE_TESTING_ENABLED=${SELECTIVE_TESTING_ENABLED:-false}, 'scout:run-all-tests' label=$(is_pr_with_label "scout:run-all-tests" && echo yes || echo no), 'critical files touched'=${SCOUT_CRITICAL_FILES_TOUCHED}" fi node scripts/scout discover-playwright-configs \ --include-custom-servers \ @@ -92,30 +93,6 @@ else buildkite-agent artifact upload "scout_playwright_configs.json" fi -RUN_SCOUT_API_TESTS=true - -if [[ -n "${AFFECTED_MODULES_FILE:-}" ]] && [[ -f "${AFFECTED_MODULES_FILE}" ]]; then - AFFECTED_MODULE_COUNT=$(node -e "console.log(JSON.parse(require('fs').readFileSync(process.env.AFFECTED_MODULES_FILE,'utf8')).length)") - if [[ "$AFFECTED_MODULE_COUNT" == "0" ]] && [[ "${SCOUT_CRITICAL_FILES_TOUCHED:-false}" != "true" ]]; then - RUN_SCOUT_API_TESTS=false - echo "Skipping Scout API Integration Tests: 0 affected modules and no critical files touched" - else - echo "Running Scout API Integration Tests: ${AFFECTED_MODULE_COUNT} affected module(s), critical files touched: ${SCOUT_CRITICAL_FILES_TOUCHED:-false}" - fi -fi - -if [[ "$RUN_SCOUT_API_TESTS" == "true" ]]; then - echo '--- Build Kibana platform plugins' - node scripts/build_kibana_platform_plugins.js - - echo '--- Running Scout API Integration Tests (against Kibana source code)' - node scripts/scout.js run-tests \ - --location local \ - --arch stateful \ - --domain classic \ - --config src/platform/packages/shared/kbn-scout/test/scout/api/parallel.playwright.config.ts -fi - source .buildkite/scripts/steps/test/scout/upload_report_events.sh echo '--- Producing Scout Test Execution Steps' From a263db2e8cc8bd17584e122ccd0dd657eeed4d13 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 14 Apr 2026 15:01:33 +0200 Subject: [PATCH 3/3] skip fleet helper tests for svl --- .../parallel_tests/api_services/fleet.spec.ts | 134 +++++++++--------- 1 file changed, 65 insertions(+), 69 deletions(-) diff --git a/src/platform/packages/shared/kbn-scout/test/scout/api/parallel_tests/api_services/fleet.spec.ts b/src/platform/packages/shared/kbn-scout/test/scout/api/parallel_tests/api_services/fleet.spec.ts index 54218f56efd07..3ed86f600b570 100644 --- a/src/platform/packages/shared/kbn-scout/test/scout/api/parallel_tests/api_services/fleet.spec.ts +++ b/src/platform/packages/shared/kbn-scout/test/scout/api/parallel_tests/api_services/fleet.spec.ts @@ -183,82 +183,78 @@ apiTest.describe( } ); -apiTest.describe( - 'Fleet Outputs Management', - { tag: [...tags.serverless.security.complete, ...tags.stateful.classic] }, - () => { - let outputId: string; - - apiTest.afterEach(async ({ apiServices }) => { - // Clean up output - if (outputId) { - await apiServices.fleet.outputs.delete(outputId); +apiTest.describe('Fleet Outputs Management', { tag: [...tags.stateful.classic] }, () => { + let outputId: string; + + apiTest.afterEach(async ({ apiServices }) => { + // Clean up output + if (outputId) { + await apiServices.fleet.outputs.delete(outputId); + } + outputId = ''; + }); + + apiTest('should get all outputs', async ({ apiServices }) => { + const response = await apiServices.fleet.outputs.getOutputs(); + + expect(response).toHaveStatusCode(200); + expect(response.data).toBeDefined(); + expect(response.data.items).toBeDefined(); + }); + + apiTest('should get a specific output by ID', async ({ apiServices }) => { + // First get all outputs to find an existing one + const allOutputsResponse = await apiServices.fleet.outputs.getOutputs(); + const existingOutput = allOutputsResponse.data.items[0]; + + // Only proceed if we have an existing output + expect(existingOutput).toBeDefined(); + + const response = await apiServices.fleet.outputs.getOutput(existingOutput.id); + + expect(response).toHaveStatusCode(200); + expect(response.data.item.id).toBe(existingOutput.id); + }); + + apiTest('should create an output with additional parameters', async ({ apiServices }) => { + const outputName = `test-output-params-${Date.now()}`; + const outputHosts = ['https://localhost:9200']; + + const response = await apiServices.fleet.outputs.create( + outputName, + outputHosts, + 'elasticsearch', + { + is_default: false, + ca_trusted_fingerprint: 'test-fingerprint', } - outputId = ''; - }); + ); - apiTest('should get all outputs', async ({ apiServices }) => { - const response = await apiServices.fleet.outputs.getOutputs(); + expect(response).toHaveStatusCode(200); + expect(response.data.item.name).toBe(outputName); + expect(response.data.item.is_default).toBe(false); - expect(response).toHaveStatusCode(200); - expect(response.data).toBeDefined(); - expect(response.data.items).toBeDefined(); - }); - - apiTest('should get a specific output by ID', async ({ apiServices }) => { - // First get all outputs to find an existing one - const allOutputsResponse = await apiServices.fleet.outputs.getOutputs(); - const existingOutput = allOutputsResponse.data.items[0]; - - // Only proceed if we have an existing output - expect(existingOutput).toBeDefined(); + outputId = response.data.item.id; + }); - const response = await apiServices.fleet.outputs.getOutput(existingOutput.id); - - expect(response).toHaveStatusCode(200); - expect(response.data.item.id).toBe(existingOutput.id); - }); + apiTest('should delete an output', async ({ apiServices }) => { + const outputName = `test-output-delete-${Date.now()}`; - apiTest('should create an output with additional parameters', async ({ apiServices }) => { - const outputName = `test-output-params-${Date.now()}`; - const outputHosts = ['https://localhost:9200']; + // First create an output + const createResponse = await apiServices.fleet.outputs.create( + outputName, + ['https://localhost:9200'], + 'elasticsearch' + ); + const deleteOutputId = createResponse.data.item.id; - const response = await apiServices.fleet.outputs.create( - outputName, - outputHosts, - 'elasticsearch', - { - is_default: false, - ca_trusted_fingerprint: 'test-fingerprint', - } - ); + // Then delete it + const response = await apiServices.fleet.outputs.delete(deleteOutputId); - expect(response).toHaveStatusCode(200); - expect(response.data.item.name).toBe(outputName); - expect(response.data.item.is_default).toBe(false); - - outputId = response.data.item.id; - }); - - apiTest('should delete an output', async ({ apiServices }) => { - const outputName = `test-output-delete-${Date.now()}`; - - // First create an output - const createResponse = await apiServices.fleet.outputs.create( - outputName, - ['https://localhost:9200'], - 'elasticsearch' - ); - const deleteOutputId = createResponse.data.item.id; - - // Then delete it - const response = await apiServices.fleet.outputs.delete(deleteOutputId); - - expect(response).toHaveStatusCode(200); - // Don't set outputId since we already deleted it - }); - } -); + expect(response).toHaveStatusCode(200); + // Don't set outputId since we already deleted it + }); +}); apiTest.describe( 'Fleet Server Hosts Management',