Skip to content

Add kbn/test-es-server package#259064

Merged
dmlemeshko merged 13 commits intoelastic:mainfrom
dmlemeshko:add-kbn-test-es-server
Mar 26, 2026
Merged

Add kbn/test-es-server package#259064
dmlemeshko merged 13 commits intoelastic:mainfrom
dmlemeshko:add-kbn-test-es-server

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko commented Mar 23, 2026

Summary

Introduces @kbn/test-es-server as a focused package for starting/managing Elasticsearch in tests (cluster helpers, ES test config, createEsClientForTesting, cleanup, CI parallel prefix). @kbn/test and @kbn/scout depend on it and keep re-exporting the same public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in @kbn/test (e.g. createEsClientForFtrConfig in ftr_es_client.ts).

@kbn/evals now imports createEsClientForTesting from @kbn/test-es-server instead of @kbn/test, aligning it with the Scout-side ES client path and trimming the implied dependency on the full test harness for that call.

Why

  • Clearer boundaries: ES test-server concerns live in one place; @kbn/test stays the broader FTR/harness package.
  • Easier evolution: Scout and other tooling can depend on ES test infrastructure without pulling all of @kbn/test when they only need ES helpers.

Scope

  • New @kbn/test-es-server package and repo wiring (paths, links, moon/tsconfig as required).
  • @kbn/test / @kbn/scout: delegate ES cluster/client/config/cleanup (and related imports) to the new package; FTR helpers remain in @kbn/test.
  • @kbn/evals: switch createEsClientForTesting to @kbn/test-es-server and update package references.

@dmlemeshko dmlemeshko changed the title Add kbn test es server Add kbn/test-es-server package Mar 23, 2026
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Mar 23, 2026
@dmlemeshko dmlemeshko marked this pull request as ready for review March 23, 2026 13:44
@dmlemeshko dmlemeshko requested review from a team as code owners March 23, 2026 13:44
@csr csr self-requested a review March 23, 2026 14:38
Copy link
Copy Markdown
Member

@csr csr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmlemeshko
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: da154632-dede-4a16-9ad7-823ab0b97272

📥 Commits

Reviewing files that changed from the base of the PR and between 41358ce and 2e88053.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (31)
  • .github/CODEOWNERS
  • package.json
  • packages/kbn-repo-source-classifier/src/repo_source_classifier.ts
  • src/platform/packages/shared/kbn-scout/moon.yml
  • src/platform/packages/shared/kbn-scout/src/common/services/clients.ts
  • src/platform/packages/shared/kbn-scout/src/servers/run_elasticsearch.ts
  • src/platform/packages/shared/kbn-scout/tsconfig.json
  • src/platform/packages/shared/kbn-test-es-server/index.ts
  • src/platform/packages/shared/kbn-test-es-server/jest.config.js
  • src/platform/packages/shared/kbn-test-es-server/kibana.jsonc
  • src/platform/packages/shared/kbn-test-es-server/moon.yml
  • src/platform/packages/shared/kbn-test-es-server/package.json
  • src/platform/packages/shared/kbn-test-es-server/src/ci_parallel_process_prefix.ts
  • src/platform/packages/shared/kbn-test-es-server/src/cleanup_elasticsearch.ts
  • src/platform/packages/shared/kbn-test-es-server/src/es_client_for_testing.ts
  • src/platform/packages/shared/kbn-test-es-server/src/es_test_config.ts
  • src/platform/packages/shared/kbn-test-es-server/src/test_es_cluster.ts
  • src/platform/packages/shared/kbn-test-es-server/tsconfig.json
  • src/platform/packages/shared/kbn-test/index.ts
  • src/platform/packages/shared/kbn-test/moon.yml
  • src/platform/packages/shared/kbn-test/src/ftr_es_client.ts
  • src/platform/packages/shared/kbn-test/src/functional_test_runner/functional_test_runner.ts
  • src/platform/packages/shared/kbn-test/src/functional_tests/lib/index.ts
  • src/platform/packages/shared/kbn-test/src/functional_tests/lib/run_elasticsearch.ts
  • src/platform/packages/shared/kbn-test/src/report_path.ts
  • src/platform/packages/shared/kbn-test/tsconfig.json
  • tsconfig.base.json
  • x-pack/platform/packages/shared/kbn-evals/moon.yml
  • x-pack/platform/packages/shared/kbn-evals/src/cli/commands/compare.ts
  • x-pack/platform/packages/shared/kbn-evals/src/evaluate.ts
  • x-pack/platform/packages/shared/kbn-evals/tsconfig.json

📝 Walkthrough

Walkthrough

This change introduces a new shared package @kbn/test-es-server that extracts Elasticsearch testing utilities previously located in @kbn/test. The new package consolidates ES cluster management, test client factories, and configuration into a dedicated module. Existing packages are updated to import from the new module, while @kbn/test re-exports the moved utilities for backward compatibility. The repository configuration files—including tsconfig.base.json, CODEOWNERS, Moon build files, and package references—are updated to recognize and depend on the new package. Two FTR-specific client factories remain in @kbn/test/src/ftr_es_client.ts.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dmlemeshko dmlemeshko enabled auto-merge (squash) March 26, 2026 09:17
@dmlemeshko dmlemeshko merged commit 592399b into elastic:main Mar 26, 2026
19 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23589969902

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #1 / serverless search UI Rule details Header renders the rule details

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/test-es-server - 30 +30
Unknown metric groups

API count

id before after diff
@kbn/test-es-server - 48 +48

History

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.2 Backport failed because of merge conflicts
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- move kbn-client into its own package (#258963)
- Update dependency @moonrepo/cli to v2 (main) (#256118)

Manual backport

To create the backport manually run:

node scripts/backport --pr 259064

Questions ?

Please refer to the Backport tool documentation

shahargl pushed a commit to shahargl/kibana that referenced this pull request Mar 26, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope 
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 27, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 259064 locally
cc: @dmlemeshko

dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Mar 28, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 592399b)

# Conflicts:
#	x-pack/platform/packages/shared/kbn-evals/src/cli/commands/compare.ts
#	x-pack/platform/packages/shared/kbn-evals/tsconfig.json
@dmlemeshko
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Mar 28, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 592399b)

# Conflicts:
#	x-pack/platform/packages/shared/kbn-evals/moon.yml
#	x-pack/platform/packages/shared/kbn-evals/src/cli/commands/compare.ts
#	x-pack/platform/packages/shared/kbn-evals/src/evaluate.ts
#	x-pack/platform/packages/shared/kbn-evals/tsconfig.json
@dmlemeshko
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dmlemeshko added a commit that referenced this pull request Mar 30, 2026
# Backport

This will backport the following commits from `main` to `9.2`:
- [Add kbn/test-es-server package
(#259064)](#259064)

<!--- Backport version: 11.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T10:39:23Z","message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:all-open","v9.4.0"],"title":"Add kbn/test-es-server
package","number":259064,"url":"https://github.com/elastic/kibana/pull/259064","mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259064","number":259064,"mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}},{"url":"https://github.com/elastic/kibana/pull/260139","number":260139,"branch":"9.3","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
dmlemeshko added a commit that referenced this pull request Mar 30, 2026
# Backport

This will backport the following commits from `main` to `9.3`:
- [Add kbn/test-es-server package
(#259064)](#259064)

<!--- Backport version: 11.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T10:39:23Z","message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:all-open","v9.4.0"],"title":"Add kbn/test-es-server
package","number":259064,"url":"https://github.com/elastic/kibana/pull/259064","mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259064","number":259064,"mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}}]}]
BACKPORT-->
@kibanamachine kibanamachine added v9.3.3 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Mar 30, 2026
dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Mar 30, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 592399b)

# Conflicts:
#	.github/CODEOWNERS
#	packages/kbn-repo-source-classifier/src/repo_source_classifier.ts
#	src/platform/packages/shared/kbn-scout/src/common/services/clients.ts
#	src/platform/packages/shared/kbn-test-es-server/src/es_client_for_testing.ts
#	src/platform/packages/shared/kbn-test-saml-auth/moon.yml
#	src/platform/packages/shared/kbn-test/src/functional_tests/lib/run_elasticsearch.ts
#	src/platform/packages/shared/kbn-test/tsconfig.json
#	x-pack/platform/packages/shared/kbn-evals/src/cli/commands/compare.ts
#	x-pack/platform/packages/shared/kbn-evals/src/evaluate.ts
#	x-pack/platform/packages/shared/kbn-evals/tsconfig.json
@dmlemeshko
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dmlemeshko added a commit that referenced this pull request Mar 30, 2026
# Backport

This will backport the following commits from `main` to `8.19`:
- [Add kbn/test-es-server package
(#259064)](#259064)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T10:39:23Z","message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0","v9.3.3","v9.2.8"],"title":"Add
kbn/test-es-server
package","number":259064,"url":"https://github.com/elastic/kibana/pull/259064","mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259064","number":259064,"mergeCommit":{"message":"Add
kbn/test-es-server package (#259064)\n\n## Summary\n\nIntroduces
`@kbn/test-es-server` as a focused package for\nstarting/managing
Elasticsearch in tests (cluster helpers, ES test\nconfig,
createEsClientForTesting, cleanup, CI parallel prefix).\n`@kbn/test` and
`@kbn/scout` depend on it and keep re-exporting the same\npublic surface
where needed so existing imports keep working.\n\nFTR-specific wiring
that needs the FTR Config type stays in `@kbn/test`\n(e.g.
`createEsClientForFtrConfig` in `ftr_es_client.ts`).\n\n`@kbn/evals` now
imports `createEsClientForTesting` from\n`@kbn/test-es-server` instead
of `@kbn/test`, aligning it with the\nScout-side ES client path and
trimming the implied dependency on the\nfull test harness for that
call.\n\n### Why\n- Clearer boundaries: ES test-server concerns live in
one place;\n@kbn/test stays the broader FTR/harness package.\n- Easier
evolution: Scout and other tooling can depend on ES test\ninfrastructure
without pulling all of @kbn/test when they only need ES\nhelpers.\n\n###
Scope \n- New `@kbn/test-es-server` package and repo wiring (paths,
links,\nmoon/tsconfig as required).\n- `@kbn/test` / `@kbn/scout`:
delegate ES cluster/client/config/cleanup\n(and related imports) to the
new package; FTR helpers remain in\n`@kbn/test.`\n- `@kbn/evals`: switch
`createEsClientForTesting` to\n`@kbn/test-es-server` and update package
references.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"592399bbf8fbb25af3b4e4aab580e1f29c546324"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/260139","number":260139,"state":"MERGED","mergeCommit":{"sha":"da06eedcf770f6a737d51d4181ff721d467e97d1","message":"[9.3]
Add kbn/test-es-server package (#259064) (#260139)\n\n# Backport\n\nThis
will backport the following commits from `main` to `9.3`:\n- [Add
kbn/test-es-server
package\n(#259064)](https://github.com/elastic/kibana/pull/259064)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/260140","number":260140,"state":"MERGED","mergeCommit":{"sha":"467b441609bf4587fca013cd4c72b92e8607cb74","message":"[9.2]
Add kbn/test-es-server package (#259064) (#260140)\n\n# Backport\n\nThis
will backport the following commits from `main` to `9.2`:\n- [Add
kbn/test-es-server
package\n(#259064)](https://github.com/elastic/kibana/pull/259064)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\n---------\n\nCo-authored-by:
kibanamachine <42973632+kibanamachine@users.noreply.github.com>"}}]}]
BACKPORT-->
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope 
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
## Summary

Introduces `@kbn/test-es-server` as a focused package for
starting/managing Elasticsearch in tests (cluster helpers, ES test
config, createEsClientForTesting, cleanup, CI parallel prefix).
`@kbn/test` and `@kbn/scout` depend on it and keep re-exporting the same
public surface where needed so existing imports keep working.

FTR-specific wiring that needs the FTR Config type stays in `@kbn/test`
(e.g. `createEsClientForFtrConfig` in `ftr_es_client.ts`).

`@kbn/evals` now imports `createEsClientForTesting` from
`@kbn/test-es-server` instead of `@kbn/test`, aligning it with the
Scout-side ES client path and trimming the implied dependency on the
full test harness for that call.

### Why
- Clearer boundaries: ES test-server concerns live in one place;
@kbn/test stays the broader FTR/harness package.
- Easier evolution: Scout and other tooling can depend on ES test
infrastructure without pulling all of @kbn/test when they only need ES
helpers.

### Scope 
- New `@kbn/test-es-server` package and repo wiring (paths, links,
moon/tsconfig as required).
- `@kbn/test` / `@kbn/scout`: delegate ES cluster/client/config/cleanup
(and related imports) to the new package; FTR helpers remain in
`@kbn/test.`
- `@kbn/evals`: switch `createEsClientForTesting` to
`@kbn/test-es-server` and update package references.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes v8.19.14 v9.2.8 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants