diff options
author | David Pilato <david@pilato.fr> | 2015-09-10 17:17:10 +0200 |
---|---|---|
committer | David Pilato <david@pilato.fr> | 2015-09-15 10:10:05 +0200 |
commit | a38bcc5d629065cc724e7cb7edaabb5c2074dc25 (patch) | |
tree | 18e7a19a603c1e5e3d178b04aab6214a3cf38efb /plugins/analysis-stempel | |
parent | de2fcd4be45534f49b6fc502154c465f1e7832c2 (diff) |
[test] plugins simple RestIT tests don't work from IDE
When running a RestIT test from the IDE, you actually start an internal node which does not automatically load the plugin you would like to test.
We need to add:
```java
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return pluginList(PLUGIN_HERE.class);
}
```
Everything works fine when running from maven because each test basically:
* installs elasticsearch
* installs one plugin
* starts elasticsearch with this plugin loaded
* runs the test
Note that this PR only fixes the fact we run an internal cluster with the expected plugin.
Cloud tests will still fail when run from the IDE because is such a case you actually start an internal node with many mock plugins.
And REST test suite for cloud plugins basically checks if the plugin is running by checking the output of NodesInfo API.
And we check:
```yml
- match: { nodes.$master.plugins.0.name: cloud-azure }
- match: { nodes.$master.plugins.0.jvm: true }
```
But in that case, this condition is certainly false as we started also `mock-transport-service`, `mock-index-store`, `mock-engine-factory`, `node-mocks`, `asserting-local-transport`, `mock-search-service`.
Closes #13479
Diffstat (limited to 'plugins/analysis-stempel')
-rw-r--r-- | plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java index 330ad87af7..c99ff75aeb 100644 --- a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java +++ b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java @@ -21,14 +21,22 @@ package org.elasticsearch.index.analysis; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.plugin.analysis.stempel.AnalysisStempelPlugin; +import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; import org.elasticsearch.test.rest.parser.RestTestParseException; import java.io.IOException; +import java.util.Collection; public class AnalysisPolishRestIT extends ESRestTestCase { + @Override + protected Collection<Class<? extends Plugin>> nodePlugins() { + return pluginList(AnalysisStempelPlugin.class); + } + public AnalysisPolishRestIT(@Name("yaml") RestTestCandidate testCandidate) { super(testCandidate); } |