Skip to content

[Upgrade Assistant] Migrate Kibana deprecations flaky integration tests to unit tests#258981

Merged
kapral18 merged 4 commits intoelastic:mainfrom
kapral18:chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915
Mar 26, 2026
Merged

[Upgrade Assistant] Migrate Kibana deprecations flaky integration tests to unit tests#258981
kapral18 merged 4 commits intoelastic:mainfrom
kapral18:chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

@kapral18 kapral18 commented Mar 22, 2026

Summary

  • Migrates Kibana deprecations coverage from flaky client integration tests to focused unit tests.
  • Adds unit coverage for the Kibana deprecations list/table (refresh, counts, filters/clear, details link) and the details flyout (manual steps, docs link, quick resolve success/failure).
  • Removes legacy __jest__/client_integration/kibana_deprecations specs and drops shared_imports usage in favor of @kbn/es-ui-shared-plugin/public imports.

Closes

Coverage mapping

Test plan

  • node scripts/check_changes.ts
  • yarn test:jest x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations --silent

Assisted with Cursor using GPT-5.2

@kapral18 kapral18 force-pushed the chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915 branch from d99525f to bb3ed6f Compare March 22, 2026 16:08
@kapral18 kapral18 marked this pull request as ready for review March 22, 2026 16:09
@kapral18 kapral18 requested a review from a team as a code owner March 22, 2026 16:09
@kapral18 kapral18 added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// Feature:Upgrade Assistant release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.3.3 v9.4.0 labels Mar 22, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 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: 659e09df-037d-4a54-8061-8ecd168f76dc

📥 Commits

Reviewing files that changed from the base of the PR and between 3661c15 and bb3ed6f.

📒 Files selected for processing (8)
  • x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout/deprecation_details_flyout.test.ts
  • x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts
  • x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/error_handling.test.ts
  • x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/kibana_deprecations.helpers.tsx
  • x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.test.tsx
  • x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.test.tsx
  • x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations.tsx
  • x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations/kibana_deprecations_table.test.tsx
💤 Files with no reviewable changes (4)
  • x-pack/platform/plugins/private/upgrade_assistant/jest/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts
  • x-pack/platform/plugins/private/upgrade_assistant/jest/client_integration/kibana_deprecations/kibana_deprecations.helpers.tsx
  • x-pack/platform/plugins/private/upgrade_assistant/jest/client_integration/kibana_deprecations/deprecation_details_flyout/deprecation_details_flyout.test.ts
  • x-pack/platform/plugins/private/upgrade_assistant/jest/client_integration/kibana_deprecations/deprecations_table/error_handling.test.ts

📝 Walkthrough

Walkthrough

This change migrates test coverage for the Kibana deprecations feature from integration-style tests in the __jest__/client_integration directory to colocated unit/component tests. The old test files (deprecation_details_flyout.test.ts, deprecations_table.test.ts, error_handling.test.ts) and their helper (kibana_deprecations.helpers.tsx) are removed. New component-level tests are added (deprecation_details_flyout.test.tsx, kibana_deprecations.test.tsx, kibana_deprecations_table.test.tsx) that cover rendering, user interactions, error handling, and state management using mocked services. Additionally, imports for MissingPrivileges, WithPrivileges, SectionLoading, and GlobalFlyout are updated to source from @kbn/es-ui-shared-plugin/public instead of local shared imports.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR successfully migrates flaky client integration tests to focused unit tests, directly addressing issue #253915.
Out of Scope Changes check ✅ Passed All changes are scoped to test migration and import refactoring. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

@kapral18 kapral18 force-pushed the chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915 branch from bb3ed6f to 8862f7f Compare March 23, 2026 16:42
@kapral18 kapral18 force-pushed the chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915 branch from 8862f7f to e3c1c6e Compare March 24, 2026 20:29
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / buildEsqlFetchSubscribe changing a ES|QL query with no transformational commands should not change state when loading and finished if index pattern and columns are the same
  • [job] [logs] Jest Tests #6 / StatefulOpenTimeline it invokes onOpenTimeline with the expected parameters when the hyperlink is clicked

Metrics [docs]

✅ unchanged

History

Copy link
Copy Markdown
Contributor

@damian-polewski damian-polewski left a comment

Choose a reason for hiding this comment

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

Great job migrating those integration tests to unit tests! I have two small comment but overall looks good!

kapral18 and others added 2 commits March 26, 2026 12:40
…ts to unit tests

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kapral18 kapral18 force-pushed the chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915 branch from e3c1c6e to d7db7f6 Compare March 26, 2026 11:40
kapral18 and others added 2 commits March 26, 2026 12:53
…ogress resolve

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown
Contributor

@damian-polewski damian-polewski left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my feedback! LGTM!

@kapral18 kapral18 merged commit 5c40b03 into elastic:main Mar 26, 2026
18 checks passed
@kapral18 kapral18 deleted the chore/upgrade-assistant/fix-kibana-deprecations-flaky-tests-253915 branch March 26, 2026 20:44
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- [Upgrade Assistant] Migrate ES deprecations flaky integration tests to unit tests (#258142)
- [Index Management] Migrate flaky integration tests to unit tests (#258942)
- [Dashboards] Fix backups service (#257762)
- [Security Solution] only show notes for a saved timeline (ignoring emtpy string from draft timelines) (#259658)
- [Security Solution][Detection Engine] Fix alert count so max alerts warning shows correctly (#259199)

Manual backport

To create the backport manually run:

node scripts/backport --pr 258981

Questions ?

Please refer to the Backport tool documentation

mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 26, 2026
…hanges

* commit '22bf09c82658b9511cbb2ad13f6dd29ad3526472': (21 commits)
  [Overlays System Flyout]: Support Child History (elastic#256339)
  KUA-Update event naming format and examples (elastic#259846)
  Fix pagerduty connector codeownership (elastic#259807)
  [Upgrade Assistant] Migrate Kibana deprecations flaky integration tests to unit tests (elastic#258981)
  [Upgrade Assistant] Migrate ES deprecations flaky integration tests to unit tests (elastic#258142)
  [Index Management] Migrate flaky integration tests to unit tests (elastic#258942)
  [Cases] Rename attachment id to saved object id (elastic#259158)
  [Entity Store] Change hash algo to sha256 (elastic#259453)
  [Security Solution] fixed enhanced security profile header showing for non-alert documents (elastic#259801)
  Update LaunchDarkly (main) (elastic#259008)
  [Discover] Add observability default ES|QL query (elastic#257268)
  Update dependency @redocly/cli to v2.21.1 (main) (elastic#259016)
  Gap reason detected (elastic#258231)
  [One Workflow] Historical executionContext and telemetry (elastic#258623)
  coderabbit: drop SigEvents (elastic#259863)
  [ci] Bump cypress disk (elastic#259861)
  Server timings (elastic#258915)
  Replace deprecated EUI icons in files owned by @elastic/kibana-cases (elastic#255633)
  [ci] Bump storybooks disk (elastic#259858)
  [drilldowns] require embeddables to opt into ON_OPEN_PANEL_MENU trigger (elastic#259637)
  ...
kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 28, 2026
…ts to unit tests (elastic#258981)

## Summary
- Migrates Kibana deprecations coverage from flaky client integration
tests to focused unit tests.
- Adds unit coverage for the Kibana deprecations list/table (refresh,
counts, filters/clear, details link) and the details flyout (manual
steps, docs link, quick resolve success/failure).
- Removes legacy `__jest__/client_integration/kibana_deprecations` specs
and drops `shared_imports` usage in favor of
`@kbn/es-ui-shared-plugin/public` imports.

## Closes
- Closes elastic#253915

## Coverage mapping
- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)

## Test plan
- [x] `node scripts/check_changes.ts`
- [x] `yarn test:jest
x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations
--silent`

Assisted with Cursor using GPT-5.2

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 5c40b03)

# Conflicts:
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout/deprecation_details_flyout.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/error_handling.test.ts
@kapral18
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

kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 30, 2026
…ts to unit tests (elastic#258981)

## Summary
- Migrates Kibana deprecations coverage from flaky client integration
tests to focused unit tests.
- Adds unit coverage for the Kibana deprecations list/table (refresh,
counts, filters/clear, details link) and the details flyout (manual
steps, docs link, quick resolve success/failure).
- Removes legacy `__jest__/client_integration/kibana_deprecations` specs
and drops `shared_imports` usage in favor of
`@kbn/es-ui-shared-plugin/public` imports.

## Closes
- Closes elastic#253915

## Coverage mapping
- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)

## Test plan
- [x] `node scripts/check_changes.ts`
- [x] `yarn test:jest
x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations
--silent`

Assisted with Cursor using GPT-5.2

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 5c40b03)

# Conflicts:
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout/deprecation_details_flyout.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/error_handling.test.ts
kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 30, 2026
…ts to unit tests (elastic#258981)

## Summary
- Migrates Kibana deprecations coverage from flaky client integration
tests to focused unit tests.
- Adds unit coverage for the Kibana deprecations list/table (refresh,
counts, filters/clear, details link) and the details flyout (manual
steps, docs link, quick resolve success/failure).
- Removes legacy `__jest__/client_integration/kibana_deprecations` specs
and drops `shared_imports` usage in favor of
`@kbn/es-ui-shared-plugin/public` imports.

## Closes
- Closes elastic#253915

## Coverage mapping
- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)

## Test plan
- [x] `node scripts/check_changes.ts`
- [x] `yarn test:jest
x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations
--silent`

Assisted with Cursor using GPT-5.2

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 5c40b03)

# Conflicts:
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout/deprecation_details_flyout.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/deprecations_table.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecations_table/error_handling.test.ts
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 30, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @kapral18

kapral18 added a commit that referenced this pull request Mar 31, 2026
…on tests to unit tests (#258981) (#260129)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Upgrade Assistant] Migrate Kibana deprecations flaky integration
tests to unit tests
(#258981)](#258981)

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

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

<!--BACKPORT [{"author":{"name":"Karen
Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T20:44:19Z","message":"[Upgrade
Assistant] Migrate Kibana deprecations flaky integration tests to unit
tests (#258981)\n\n## Summary\n- Migrates Kibana deprecations coverage
from flaky client integration\ntests to focused unit tests.\n- Adds unit
coverage for the Kibana deprecations list/table (refresh,\ncounts,
filters/clear, details link) and the details flyout (manual\nsteps, docs
link, quick resolve success/failure).\n- Removes legacy
`__jest__/client_integration/kibana_deprecations` specs\nand drops
`shared_imports` usage in favor of\n`@kbn/es-ui-shared-plugin/public`
imports.\n\n## Closes\n- Closes #253915\n\n## Coverage mapping\n-
[Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)\n\n##
Test plan\n- [x] `node scripts/check_changes.ts`\n- [x] `yarn
test:jest\nx-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations\n--silent`\n\nAssisted
with Cursor using GPT-5.2\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"5c40b037970f01fe07af8e97cc4e18a626b32f88","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Upgrade
Assistant","backport:version","v9.4.0","v9.3.3"],"title":"[Upgrade
Assistant] Migrate Kibana deprecations flaky integration tests to unit
tests","number":258981,"url":"https://github.com/elastic/kibana/pull/258981","mergeCommit":{"message":"[Upgrade
Assistant] Migrate Kibana deprecations flaky integration tests to unit
tests (#258981)\n\n## Summary\n- Migrates Kibana deprecations coverage
from flaky client integration\ntests to focused unit tests.\n- Adds unit
coverage for the Kibana deprecations list/table (refresh,\ncounts,
filters/clear, details link) and the details flyout (manual\nsteps, docs
link, quick resolve success/failure).\n- Removes legacy
`__jest__/client_integration/kibana_deprecations` specs\nand drops
`shared_imports` usage in favor of\n`@kbn/es-ui-shared-plugin/public`
imports.\n\n## Closes\n- Closes #253915\n\n## Coverage mapping\n-
[Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)\n\n##
Test plan\n- [x] `node scripts/check_changes.ts`\n- [x] `yarn
test:jest\nx-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations\n--silent`\n\nAssisted
with Cursor using GPT-5.2\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"5c40b037970f01fe07af8e97cc4e18a626b32f88"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258981","number":258981,"mergeCommit":{"message":"[Upgrade
Assistant] Migrate Kibana deprecations flaky integration tests to unit
tests (#258981)\n\n## Summary\n- Migrates Kibana deprecations coverage
from flaky client integration\ntests to focused unit tests.\n- Adds unit
coverage for the Kibana deprecations list/table (refresh,\ncounts,
filters/clear, details link) and the details flyout (manual\nsteps, docs
link, quick resolve success/failure).\n- Removes legacy
`__jest__/client_integration/kibana_deprecations` specs\nand drops
`shared_imports` usage in favor of\n`@kbn/es-ui-shared-plugin/public`
imports.\n\n## Closes\n- Closes #253915\n\n## Coverage mapping\n-
[Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)\n\n##
Test plan\n- [x] `node scripts/check_changes.ts`\n- [x] `yarn
test:jest\nx-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations\n--silent`\n\nAssisted
with Cursor using GPT-5.2\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"5c40b037970f01fe07af8e97cc4e18a626b32f88"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 31, 2026
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…ts to unit tests (elastic#258981)

## Summary
- Migrates Kibana deprecations coverage from flaky client integration
tests to focused unit tests.
- Adds unit coverage for the Kibana deprecations list/table (refresh,
counts, filters/clear, details link) and the details flyout (manual
steps, docs link, quick resolve success/failure).
- Removes legacy `__jest__/client_integration/kibana_deprecations` specs
and drops `shared_imports` usage in favor of
`@kbn/es-ui-shared-plugin/public` imports.

## Closes
- Closes elastic#253915

## Coverage mapping
- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)

## Test plan
- [x] `node scripts/check_changes.ts`
- [x] `yarn test:jest
x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations
--silent`

Assisted with Cursor using GPT-5.2

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…ts to unit tests (elastic#258981)

## Summary
- Migrates Kibana deprecations coverage from flaky client integration
tests to focused unit tests.
- Adds unit coverage for the Kibana deprecations list/table (refresh,
counts, filters/clear, details link) and the details flyout (manual
steps, docs link, quick resolve success/failure).
- Removes legacy `__jest__/client_integration/kibana_deprecations` specs
and drops `shared_imports` usage in favor of
`@kbn/es-ui-shared-plugin/public` imports.

## Closes
- Closes elastic#253915

## Coverage mapping
- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/a3d2f778d575daa2f3dfcd8e0f4b66e4)

## Test plan
- [x] `node scripts/check_changes.ts`
- [x] `yarn test:jest
x-pack/platform/plugins/private/upgrade_assistant/public/application/components/kibana_deprecations
--silent`

Assisted with Cursor using GPT-5.2

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Upgrade Assistant release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v9.3.3 v9.4.0

Projects

None yet

4 participants