# Best practices: testing, cluster configuration, data analysis integrity, query results

**URL:** <https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265>\
**Category:** Elasticsearch\
**Created:** [March 22, 2013, 4:35pm UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265 "2013-03-22T16:35:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [March 22, 2013, 4:35pm UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/1 "2013-03-22T16:35:22Z")

</div>

Hi,

I would like to ask how do people do testing of  
Elasticsearch setup/configuration, especially in Java.

For example, some search operations can be quite sensitive to even little  
mappings and analysis changes, like suggestions for example. Are there any  
common practices how to best validate setup configurations in an automated  
way. Are there already any tools that can help in testing process as  
opposed to home-grown solution? Extensions to common Java testing  
frameworks?

For example, starting two or three node cluster, creating indices, setting  
up mappings and analysis, indexing sample data and then running queries and  
validating results. This can be a lot of work, are there already any tools  
that can make this more automated/declarative/less tedious? Preferably  
maven friendly.

Thanks,  
Lukas

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 23, 2013, 12:30am UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/2 "2013-03-23T00:30:41Z")

</div>

I use TestNG and adapted the ES test code that is provided in the ES source.  
+1

Right now I'm stuck with indexing tests, not query tests, but I'd like to.

In the JDBC river I have added TestNG XML parameter files and I use  
Maven Profiles to test against different database drivers, including  
starting the river, fetching data to ES, and counting the results.

My ideas of a cool test framework are

- a collection of URLs to downloadable free test data sets (packed  
JSON?) plus pre-defined settings/mappings (and their plugin dependencies)
- a collection of test / workload scenarios to select from
- a test tool for the ES 'bin' directory to execute tests, with results  
also in JSON
- option to upload test results to the web, for ranking/comparison (to  
assist in detecting performance regressions)
- graphs, graphs, graphs...

Jörg

Am 22.03.13 17:35, schrieb Lukáš Vlček:

> Hi,
> 
> I would like to ask how do people do testing of  
> Elasticsearch setup/configuration, especially in Java.
> 
> For example, some search operations can be quite sensitive to even  
> little mappings and analysis changes, like suggestions for example.  
> Are there any common practices how to best validate setup  
> configurations in an automated way. Are there already any tools that  
> can help in testing process as opposed to home-grown solution?  
> Extensions to common Java testing frameworks?
> 
> For example, starting two or three node cluster, creating indices,  
> setting up mappings and analysis, indexing sample data and then  
> running queries and validating results. This can be a lot of work, are  
> there already any tools that can make this more  
> automated/declarative/less tedious? Preferably maven friendly.
> 
> ## Thanks, Lukas
> 
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [March 25, 2013, 9:40am UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/3 "2013-03-25T09:40:15Z")

</div>

Hi Lukas,

Same as Jorg, for specific tests I also adapt the code provided in ES  
source.

For most common cases (create/delete indices or mapping, bulk indexing  
data, etc) , I use a small test framework I developed:  
[GitHub - tlrx/elasticsearch-test: elasticsearch-test, a framework that makes elasticsearch unit testing a breeze.](https://github.com/tlrx/elasticsearch-test) . Works fine with JUnit and  
TestNG, you can see how it is used here:  
[https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/com/github/tlrx/elasticsearch/test/EsSetupTest.java](https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/com/github/tlrx/elasticsearch/test/EsSetupTest.java)

Hope this helps,

-- Tanguy

Le vendredi 22 mars 2013 17:35:22 UTC+1, Lukáš Vlček a écrit :

> Hi,
> 
> I would like to ask how do people do testing of  
> Elasticsearch setup/configuration, especially in Java.
> 
> For example, some search operations can be quite sensitive to even little  
> mappings and analysis changes, like suggestions for example. Are there any  
> common practices how to best validate setup configurations in an automated  
> way. Are there already any tools that can help in testing process as  
> opposed to home-grown solution? Extensions to common Java testing  
> frameworks?
> 
> For example, starting two or three node cluster, creating indices, setting  
> up mappings and analysis, indexing sample data and then running queries and  
> validating results. This can be a lot of work, are there already any tools  
> that can make this more automated/declarative/less tedious? Preferably  
> maven friendly.
> 
> Thanks,  
> Lukas

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [March 25, 2013, 10:05am UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/4 "2013-03-25T10:05:42Z")

</div>

Thanks,

Tanguy, your test tool looks handy. I will have a look.

Regards,  
Lukas

On Mon, Mar 25, 2013 at 10:40 AM, Tanguy [tlrx.dev@gmail.com](mailto:tlrx.dev@gmail.com) wrote:

> Hi Lukas,
> 
> Same as Jorg, for specific tests I also adapt the code provided in ES  
> source.
> 
> For most common cases (create/delete indices or mapping, bulk indexing  
> data, etc) , I use a small test framework I developed:  
> [GitHub - tlrx/elasticsearch-test: elasticsearch-test, a framework that makes elasticsearch unit testing a breeze.](https://github.com/tlrx/elasticsearch-test) . Works fine with JUnit and  
> TestNG, you can see how it is used here:
> 
> [https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/com/github/tlrx/elasticsearch/test/EsSetupTest.java](https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/com/github/tlrx/elasticsearch/test/EsSetupTest.java)
> 
> Hope this helps,
> 
> -- Tanguy
> 
> Le vendredi 22 mars 2013 17:35:22 UTC+1, Lukáš Vlček a écrit :
> 
> > Hi,
> > 
> > I would like to ask how do people do testing of Elasticsearch setup/\*\*configuration,  
> > especially in Java.
> > 
> > For example, some search operations can be quite sensitive to even little  
> > mappings and analysis changes, like suggestions for example. Are there any  
> > common practices how to best validate setup configurations in an automated  
> > way. Are there already any tools that can help in testing process as  
> > opposed to home-grown solution? Extensions to common Java testing  
> > frameworks?
> > 
> > For example, starting two or three node cluster, creating indices,  
> > setting up mappings and analysis, indexing sample data and then running  
> > queries and validating results. This can be a lot of work, are there  
> > already any tools that can make this more automated/declarative/less  
> > tedious? Preferably maven friendly.
> > 
> > Thanks,  
> > Lukas
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jilles\_van\_Gurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jilles_van_gurp/32/879_2.png) [@Jilles\_van\_Gurp](https://discuss.elastic.co/u/Jilles_van_Gurp)\
**Post date:** [March 25, 2013, 4:58pm UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/5 "2013-03-25T16:58:17Z")

</div>

Basically, you can call the Elasticsearch main class and configure it  
using system properties (e.g. System.setProperty(name,value).

```
        NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().settings(

```

EMPTY\_SETTINGS).loadConfigSettings(false);  
node = nodeBuilder.build();  
// register a shutdown hook  
Runtime.getRuntime().addShutdownHook(new Thread() {  
@Override  
public void run() {  
node.close();  
}  
});

```
        node.start();

```

I have an ESLauncherClass that does this and an corresponding initializing  
spring bean that uses it after Spring finishes loading. This setup allows  
me to inject a running es node into my spring test configuration and use it  
over the network. Apparently you can have several embedded nodes if you  
want to run a cluster in your test setup.

Jilles

On Friday, March 22, 2013 5:35:22 PM UTC+1, Lukáš Vlček wrote:

> Hi,
> 
> I would like to ask how do people do testing of  
> Elasticsearch setup/configuration, especially in Java.
> 
> For example, some search operations can be quite sensitive to even little  
> mappings and analysis changes, like suggestions for example. Are there any  
> common practices how to best validate setup configurations in an automated  
> way. Are there already any tools that can help in testing process as  
> opposed to home-grown solution? Extensions to common Java testing  
> frameworks?
> 
> For example, starting two or three node cluster, creating indices, setting  
> up mappings and analysis, indexing sample data and then running queries and  
> validating results. This can be a lot of work, are there already any tools  
> that can make this more automated/declarative/less tedious? Preferably  
> maven friendly.
> 
> Thanks,  
> Lukas

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:44am UTC](https://discuss.elastic.co/t/best-practices-testing-cluster-configuration-data-analysis-integrity-query-results/11265/6 "2017-07-06T02:44:42Z")

</div>


