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

[Remote clusters] Migrate to new ES client #98747

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Apr 29, 2021

Summary

See #73973

Jest test refactor

Server side jest tests were refactored due to the different API exposed by the client. For each test file the steps taken were:

  • Remove the test creator function, e.g. addRemoteClustersTest and associated interface TestOptions
  • Add shared variables and environment setup inside of a beforeEach
  • Provide a way to create a mocked request object with the ability to swap out the request body
  • Then in each test case we mock out the values we expect to receive from the ES endpoint

The intention was to make the tests more standardised with the patterns in our other plugins and to not introduce too much additional "test creator" functionality since this can make the tests harder to maintain.

How to test

  1. Start Kibana and ES with basic license
  2. Start a second node with ./.es/8.0.0/bin/elasticsearch -E cluster.name="elasticsearch" -E http.port=9222 -E node.name=node3 -E path.data=/tmp/data -E discovery.type=single-node
  3. Navigate to the remote clusters subsection in the management section
  4. Add a new remote cluster, specifying localhost:9301 as the seed host for the remote cluster, this should be the default publish port for the second node
  5. Save the remote cluster, check that it is connected ✅
  6. Create a second policy, with dummy values
  7. Delete both of the configured clusters

@jloleysens jloleysens added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v7.14.0 labels Apr 29, 2021
@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens jloleysens marked this pull request as ready for review April 30, 2021 08:43
@jloleysens jloleysens requested a review from a team as a code owner April 30, 2021 08:43
@elasticmachine
Copy link
Contributor

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

@yuliacech
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for migrating Remote Clusters, @jloleysens! Code changes LGTM and tested locally 👍
I'll merge and backport this as soon as CI is green again.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @yuliacech

@yuliacech yuliacech merged commit 27e3657 into elastic:master May 4, 2021
yuliacech pushed a commit to yuliacech/kibana that referenced this pull request May 4, 2021
* migrate add cluster route and jest tests

* migrated delete remote clusters route

* migrated the get route

* migrated the update route

* added shared types file

* reduce some test boilerplate

* fix type issues introduced by new types from ES client

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
yuliacech added a commit that referenced this pull request May 4, 2021
* migrate add cluster route and jest tests

* migrated delete remote clusters route

* migrated the get route

* migrated the update route

* added shared types file

* reduce some test boilerplate

* fix type issues introduced by new types from ES client

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Kibana Machine <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
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 v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants