Skip to content

[ILM] Refactor client integration tests #88593

@jloleysens

Description

@jloleysens

Summary

Currently, ILM has a non-standard + standard structure for its client integration tests. Additionally, in both of these cases, the tests that cover the edit_policy section have grown to ~2000 lines in total. We should try to refactor these tests to be more contained and integrate the non-standard test coverage into the standard test coverage for ES UI plugins.

Integrate the non-standard test coverage into the standard test coverage

Both of these files contain client integration tests that do not conform to the dir structure and helper + test structure common across ES UI plugins:

  • x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
  • x-pack/plugins/index_lifecycle_management/__jest__/components/policy_table.test.tsx

The biggest offender is edit_policy.test.tsx as it has helper function definitions in the test file. A lot of the tests here are for checking validation behaviour.

Make tests more contained

We could improve quality of life by spending some time thinking about how best to divide test coverage into separate files and sharing common test coverage functionality through helpers. For instance, we could divide coverage into phases, and prominent cross-phase functionality like rollover, searchable snapshots. Each with sub-sections for cloud vs non-cloud deployments (as needed) and each with a test for expected behavior when editing vs creating a new policy.

There is a lot of detail to consider here so some data collection and further investigation is required to figure out:

  1. How best to refactor into smaller pieces
  2. Where there might be holes in the test coverage

Metadata

Metadata

Assignees

Labels

Feature:ILMTeam:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t//chore

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions