In memory testing with RestHighLevelClient

I'm using elasticsearch 5.6, and the brand new RestHighLevelClient.

I know that previously, with the nodebuilder, it was possible to configure elastic to run in-memory for testing (i.e. as part of a unit test after the build phase) like so: nodeBuilder().local(true)...

Is it possible to run an elastic instance in memory with the new RestHighLevelClient, or by another method in version 5.6?

Thanks.

No. The Rest Client is only a client.

Is there a reason this functionality has been removed in 5.6?

You might want to read this: https://www.elastic.co/blog/elasticsearch-the-server

From the referenced post it seems that the reason you no longer support embedded is that it's unsafe for production. It's a common use case to want to unit / integration test ES code outside of a production environment; many of your clients currently do this. This is similar to in memory relational database testing, which can also be useful.

May I suggest that you consider providing some kind of support for embedded testing in a future release. This will be impacting my choice as I decide which search tool our company will use going forward, as will the quality and tone of responses I receive here.

Regards
Kieran

2 Likes

This will not happen.

To do integration tests, you can:

For sure, integration tests must be run against a real elasticsearch instance.
Unit tests should not require any third party tool to run IMHO.

2 Likes

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

I have confirm the solution posted here works for High Level Rest Client Integration Tests with single node embedded in 7.6.