Skip to content

[KQL] Migrate value suggestions API tests from FTR to Scout#272044

Draft
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:cleanup/kql-suggestions-ftr-to-scout
Draft

[KQL] Migrate value suggestions API tests from FTR to Scout#272044
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:cleanup/kql-suggestions-ftr-to-scout

Conversation

@shahzad31
Copy link
Copy Markdown
Contributor

Summary

Migrates the platform apis/suggestions FTR API-integration suite (the
value suggestions / autocomplete endpoint, POST /internal/kibana/suggestions/values/{index})
to a Scout API suite, co-located with the route owner — the kql plugin.

This:

  • Aligns test ownership with code ownership. The old FTR path was owned by
    @elastic/actionable-obs-team purely as a best-effort backfill artifact
    (#200950), even though the
    route lives in kql. Placing the tests under
    src/platform/plugins/shared/kql/test/scout/api makes them auto-inherit
    the kql CODEOWNERS entry (@elastic/kibana-presentation).
  • Removes a legacy stateful-only FTR config.

What changed

  • Added src/platform/plugins/shared/kql/test/scout/api — a Scout API suite
    (@kbn/scout) with all 12 cases ported 1:1, split across:
    • value_suggestions.spec.ts (8) — non-time-based behavior over basic_index
      (terms_agg / terms_enum, special characters, nested fields, 404/400 cases).
    • value_suggestions_time_filters.spec.ts (4) — time-based filter behavior over
      logstash-* (document-level vs index-level filtering).
  • Deleted src/platform/test/api_integration/apis/suggestions and removed it
    from the api_integration index.
  • Registered kql in .buildkite/scout_ci_config.yml (done by the generator).
  • Removed the now-stale CODEOWNERS entry for the old FTR path.

Notes

  • Fixes a latent bug from the original FTR suite: the last time-based test never
    returned/awaited its supertest chain, so its assertion couldn't fail. The Scout
    version awaits it properly.
  • The Scout esArchiver fixture only ingests data (no unload), so cleanup only
    removes the imported Kibana saved objects.

Test plan

  • node scripts/type_check --project src/platform/plugins/shared/kql/test/scout/api/tsconfig.json
  • node scripts/eslint on changed files
  • node scripts/scout.js run-tests --arch stateful --domain classic --config src/platform/plugins/shared/kql/test/scout/api/playwright.config.ts12/12 passed
  • node scripts/check.js --scope branch → lint ✓, jest (no affected configs), tsc ✓ (47 projects)

Made with Cursor

Move the platform `apis/suggestions` FTR API integration suite (value
suggestions / autocomplete endpoint) into a Scout API suite co-located
with the route owner, the `kql` plugin. This aligns test ownership with
code ownership (`@elastic/kibana-presentation`) via CODEOWNERS path
inheritance, and removes a legacy stateful-only FTR config.

- Add `src/platform/plugins/shared/kql/test/scout/api` (12 tests across
  non-time-based + time-based specs), porting all cases 1:1.
- Delete `src/platform/test/api_integration/apis/suggestions` and drop it
  from the api_integration index.
- Register `kql` in `.buildkite/scout_ci_config.yml` (done by generator).
- Remove the now-stale CODEOWNERS entry for the old FTR path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shahzad31 shahzad31 added Feature:KQL KQL release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels May 31, 2026
@github-actions github-actions Bot added the author:actionable-obs PRs authored by the actionable obs team label May 31, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting Feature:KQL KQL release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant