I have an ES plugin that basically intercepts POST requests on a specific
path and builds ES queries depending on the post data before executing
these and returning a result.
I have some unit tests that create a local node to tests the queries. My
problem is that it loads my plugin which I do not want.
Is there any way I can avoid that ? Perhaps with some specific settings ?
Here's how I'm currently getting the test es client:
This has been in flux a bit lately but the last time I checked you had to
intentionally load plugins by adding something like this to your test:
/**
* Enable plugin loading.
*/ @Override
protected Settings nodeSettings(int nodeOrdinal) {
return
ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("plugins." +
PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true).build();
}
I imagine you could always set that to false.
I believe it'd be important to add this annotation to your test though: @ElasticsearchIntegrationTest.ClusterScope(scope =
ElasticsearchIntegrationTest.Scope.SUITE, transportClientRatio = 0.0)
so that the cluster you build without your plugin doesn't get reused for
other tests that need your plugin.
I have an ES plugin that basically intercepts POST requests on a specific
path and builds ES queries depending on the post data before executing
these and returning a result.
I have some unit tests that create a local node to tests the queries. My
problem is that it loads my plugin which I do not want.
Is there any way I can avoid that ? Perhaps with some specific settings ?
Here's how I'm currently getting the test es client:
You can disable loading plugins by using a custom class loader that only
points to the 'lib' folder of the ES home, or includes the Elasticsearch
jars from dependency path, respectively.
I have an ES plugin that basically intercepts POST requests on a specific
path and builds ES queries depending on the post data before executing
these and returning a result.
I have some unit tests that create a local node to tests the queries. My
problem is that it loads my plugin which I do not want.
Is there any way I can avoid that ? Perhaps with some specific settings ?
Here's how I'm currently getting the test es client:
Exactly what I was looking for. Works like a charm
BTW, i do not use ElasticsearchIntegrationTest. Maybe I should but as tests
were written in version 0.90.3 I haven't had the time to upgrade them and
use the new testing framework.
I'm not sure how much time this would take.
Anyway thanks for your help !
regards,
Laurent
On Monday, November 3, 2014 6:57:50 PM UTC+1, Nikolas Everett wrote:
This has been in flux a bit lately but the last time I checked you had to
intentionally load plugins by adding something like this to your test:
/**
* Enable plugin loading.
*/ @Override
protected Settings nodeSettings(int nodeOrdinal) {
return
ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("plugins." +
PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true).build();
}
I imagine you could always set that to false.
I believe it'd be important to add this annotation to your test though: @ElasticsearchIntegrationTest.ClusterScope(scope =
ElasticsearchIntegrationTest.Scope.SUITE, transportClientRatio = 0.0)
so that the cluster you build without your plugin doesn't get reused for
other tests that need your plugin.
Nik
On Mon, Nov 3, 2014 at 12:50 PM, Laurent T. <lau.t...@gmail.com
<javascript:>> wrote:
Hi,
I have an ES plugin that basically intercepts POST requests on a specific
path and builds ES queries depending on the post data before executing
these and returning a result.
I have some unit tests that create a local node to tests the queries. My
problem is that it loads my plugin which I do not want.
Is there any way I can avoid that ? Perhaps with some specific settings ?
Here's how I'm currently getting the test es client:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.