Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ILM] Refactor client integration tests #88593

Closed
jloleysens opened this issue Jan 18, 2021 · 2 comments
Closed

[ILM] Refactor client integration tests #88593

jloleysens opened this issue Jan 18, 2021 · 2 comments
Assignees
Labels
chore Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@jloleysens
Copy link
Contributor

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
@jloleysens jloleysens added chore Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Jan 18, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@yuliacech
Copy link
Contributor

Closing this since the refactoring has been done in #92826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

3 participants