Recommended way of testing locally with 6.5

Hello. We're planning a 5.6 -> 6.5 upgrade here and I noticed that the local transport type has been removed in the latest version. We only use it once: for integration tests, we spin up a local ES node with transport.type set to local.

May I please ask you to tell me what is the recommended way to do that moving forward? I've had a shot using MockTcpTransportPlugin but I'm not sure I'm doing it well as am getting loads of transport handlers for action indices:data/write/bulk is already registered errors.

If you had a sample code somewhere that would be extremely helpful.

Kind regards

Running Elasticsearch as an embedded node is officially no longer supported so the recommended way to do this is to start up a separate Elasticsearch process against which to run the tests. This is how much of Elasticsearch's own test suite works.

Also note that the transport client will be deprecated in favour of the REST client in a future version.

Running an embedded node can be useful for debugging Elasticsearch's internals. You can just use the normal TCP transport to talk to it, or use a REST client, or you can call Node#client() to get a client that talks to the node directly. No need to mock anything - indeed, the MockTcpTransportPlugin is removed in master. The EsIntegTestCase and InternalTestCluster classes work together to start embedded nodes for use in test cases, so perhaps it's useful to look there too.

Some other ideas about integration testing in this thread: In memory testing with RestHighLevelClient

Also this sample project shows how to use Elasticsearch Test Classes:


1 Like

Wow thank you both for answering so fast. That is extremely helpful!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.