[8.19] Scout: enable Selective testing in Pull Requests (#261510)#263016
Merged
dmlemeshko merged 2 commits intoelastic:8.19from Apr 14, 2026
Merged
[8.19] Scout: enable Selective testing in Pull Requests (#261510)#263016dmlemeshko merged 2 commits intoelastic:8.19from
dmlemeshko merged 2 commits intoelastic:8.19from
Conversation
## Summary Closes elastic/appex-qa-team#700 This PR enables Scout selective testing as a _default test execution for every PR targeting tracked branch_ (e.g. `main`). ### What selective testing means for kibana-contributors? - When a PR build runs, `list_affected` uses git diff against the merge base to find which `@kbn/` modules have changed files (including downstream dependents) This produces a JSON array of affected module IDs. - Scout CLI uses this file to find all the matching test configs: each Scout module's config path is resolved to its `@kbn/` ID via `kibana.jsonc`. Scout config discovery filters down to only the affected modules — so CI only creates Buildkite steps for Scout tests belonging to changed modules (packages and plugins) - PR builds run only the Scout tests scoped to the changed modules, cutting wall-to-wall build time. **Critical files bypass** A new `resolve_selective_testing.ts` script runs before config discovery. In a single git invocation it: 1. Computes the affected modules and writes the JSON file consumed by `discover-playwright-configs`. 2. Checks whether any critical Scout files were touched (e.g. package.json, yarn.lock, Scout runtime packages, the CI pipeline scripts themselves) using touchedCriticalFiles against a new `CRITICAL_FILES_SCOUT` constant — following the same pattern already used for Jest unit and integration tests. If critical files are detected, selective testing is bypassed and the full suite runs. The affected-module labels on Buildkite steps are always applied regardless, since `--affected-modules` is passed unconditionally and `--selective-testing` is a separate flag. <img width="1833" height="665" alt="Screenshot 2026-04-07 at 14 17 28" src="https://github.com/user-attachments/assets/918ad0f8-28c4-471d-93fe-577264cf85f1" /> **Note**: The `scout:run-all-tests` label enforces the full test matrix while still showing which modules were affected. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit b3c3317) # Conflicts: # .buildkite/pipeline-utils/affected-packages/const.ts
Contributor
💔 Build Failed
Failed CI StepsMetrics [docs]Page load bundle
History |
dolaru
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation