Skip to content

[9.3] [Snapshot Restore] Migrate flaky repository_add integration test to unit tests (#258974)#260128

Merged
kapral18 merged 1 commit intoelastic:9.3from
kapral18:backport/9.3/pr-258974
Mar 31, 2026
Merged

[9.3] [Snapshot Restore] Migrate flaky repository_add integration test to unit tests (#258974)#260128
kapral18 merged 1 commit intoelastic:9.3from
kapral18:backport/9.3/pr-258974

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

@kapral18 kapral18 requested a review from kibanamachine as a code owner March 28, 2026 00:50
@kapral18 kapral18 added the backport This PR is a backport of another PR label Mar 28, 2026
@kapral18 kapral18 enabled auto-merge (squash) March 28, 2026 00:50
@kapral18 kapral18 force-pushed the backport/9.3/pr-258974 branch from 511594f to aedd836 Compare March 30, 2026 00:27
…nit tests (elastic#258974)

Closes elastic#248548

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

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

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6b62324)
@kapral18 kapral18 force-pushed the backport/9.3/pr-258974 branch from aedd836 to ff66a4b Compare March 30, 2026 13:20
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
snapshotRestore 252.5KB 252.5KB +53.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
snapshotRestore 19.6KB 19.7KB +62.0B

History

@kapral18 kapral18 requested a review from SoniaSanzV March 30, 2026 20:58
@kapral18 kapral18 merged commit 484b16e into elastic:9.3 Mar 31, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants