Tests: update to Lucene 4.9.0
Closes #24. (cherry picked from commit 13c60e4)
This commit is contained in:
parent
943f2552f9
commit
0bd6c72ac6
|
@ -414,7 +414,7 @@ Replaces `account`, `key` with your settings. Please, note that the test will de
|
||||||
To run test:
|
To run test:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mvn -Dtests.azure=true -Des.config=/path/to/config/file/elasticsearch.yml clean test
|
mvn -Dtests.azure=true -Dtests.config=/path/to/config/file/elasticsearch.yml clean test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -44,7 +44,7 @@ governing permissions and limitations under the License. -->
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<elasticsearch.version>2.0.0-SNAPSHOT</elasticsearch.version>
|
<elasticsearch.version>2.0.0-SNAPSHOT</elasticsearch.version>
|
||||||
<lucene.version>4.8.1</lucene.version>
|
<lucene.version>4.9.0</lucene.version>
|
||||||
<tests.output>onerror</tests.output>
|
<tests.output>onerror</tests.output>
|
||||||
<tests.shuffle>true</tests.shuffle>
|
<tests.shuffle>true</tests.shuffle>
|
||||||
<tests.output>onerror</tests.output>
|
<tests.output>onerror</tests.output>
|
||||||
|
@ -203,7 +203,7 @@ governing permissions and limitations under the License. -->
|
||||||
<tests.integration>${tests.integration}</tests.integration>
|
<tests.integration>${tests.integration}</tests.integration>
|
||||||
<tests.cluster_seed>${tests.cluster_seed}</tests.cluster_seed>
|
<tests.cluster_seed>${tests.cluster_seed}</tests.cluster_seed>
|
||||||
<tests.client.ratio>${tests.client.ratio}</tests.client.ratio>
|
<tests.client.ratio>${tests.client.ratio}</tests.client.ratio>
|
||||||
<es.config>${es.config}</es.config>
|
<tests.config>${tests.config}</tests.config>
|
||||||
<es.logger.level>${es.logger.level}</es.logger.level>
|
<es.logger.level>${es.logger.level}</es.logger.level>
|
||||||
<java.awt.headless>true</java.awt.headless>
|
<java.awt.headless>true</java.awt.headless>
|
||||||
</systemProperties>
|
</systemProperties>
|
||||||
|
|
|
@ -20,6 +20,12 @@
|
||||||
package org.elasticsearch.cloud.azure;
|
package org.elasticsearch.cloud.azure;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.TestGroup;
|
import com.carrotsearch.randomizedtesting.annotations.TestGroup;
|
||||||
|
import org.elasticsearch.common.Strings;
|
||||||
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.env.Environment;
|
||||||
|
import org.elasticsearch.env.FailedToResolveConfigException;
|
||||||
|
import org.elasticsearch.plugins.PluginsService;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
|
@ -34,27 +40,7 @@ public abstract class AbstractAzureTest extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Annotation for tests that require Azure to run. Azure tests are disabled by default.
|
* Annotation for tests that require Azure to run. Azure tests are disabled by default.
|
||||||
* <p/>
|
* See README file for details.
|
||||||
* To enable test add -Dtests.azure=true -Des.config=/path/to/elasticsearch.yml
|
|
||||||
* <p/>
|
|
||||||
* The elasticsearch.yml file should contain the following keys
|
|
||||||
* <pre>
|
|
||||||
cloud:
|
|
||||||
azure:
|
|
||||||
keystore: FULLPATH-TO-YOUR-KEYSTORE
|
|
||||||
password: YOUR-PASSWORD
|
|
||||||
subscription_id: YOUR-AZURE-SUBSCRIPTION-ID
|
|
||||||
service_name: YOUR-AZURE-SERVICE-NAME
|
|
||||||
|
|
||||||
discovery:
|
|
||||||
type: azure
|
|
||||||
|
|
||||||
repositories:
|
|
||||||
azure:
|
|
||||||
account: "yourstorageaccount"
|
|
||||||
key: "storage key"
|
|
||||||
container: "container name"
|
|
||||||
* </pre>
|
|
||||||
*/
|
*/
|
||||||
@Documented
|
@Documented
|
||||||
@Inherited
|
@Inherited
|
||||||
|
@ -67,4 +53,25 @@ public abstract class AbstractAzureTest extends ElasticsearchIntegrationTest {
|
||||||
*/
|
*/
|
||||||
public static final String SYSPROP_AZURE = "tests.azure";
|
public static final String SYSPROP_AZURE = "tests.azure";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
ImmutableSettings.Builder settings = ImmutableSettings.builder()
|
||||||
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
|
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true);
|
||||||
|
|
||||||
|
Environment environment = new Environment();
|
||||||
|
|
||||||
|
// if explicit, just load it and don't load from env
|
||||||
|
try {
|
||||||
|
if (Strings.hasText(System.getProperty("tests.config"))) {
|
||||||
|
settings.loadFromUrl(environment.resolveConfig(System.getProperty("tests.config")));
|
||||||
|
} else {
|
||||||
|
fail("to run integration tests, you need to set -Dtest.azure=true and -Dtests.config=/path/to/elasticsearch.yml");
|
||||||
|
}
|
||||||
|
} catch (FailedToResolveConfigException exception) {
|
||||||
|
fail("your test configuration file is incorrect: " + System.getProperty("tests.config"));
|
||||||
|
}
|
||||||
|
return settings.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.cloud.azure.AbstractAzureTest;
|
||||||
import org.elasticsearch.cloud.azure.AzureComputeService;
|
import org.elasticsearch.cloud.azure.AzureComputeService;
|
||||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.plugins.PluginsService;
|
|
||||||
|
|
||||||
public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest {
|
public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest {
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest
|
||||||
|
|
||||||
protected Settings settingsBuilder() {
|
protected Settings settingsBuilder() {
|
||||||
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
|
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
|
||||||
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true)
|
|
||||||
.put("discovery.type", "azure")
|
.put("discovery.type", "azure")
|
||||||
.put("cloud.azure.api.impl", mock)
|
.put("cloud.azure.api.impl", mock)
|
||||||
// We add a fake subscription_id to start mock compute service
|
// We add a fake subscription_id to start mock compute service
|
||||||
|
@ -54,6 +52,8 @@ public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest
|
||||||
.put("cloud.azure.password", "dummy")
|
.put("cloud.azure.password", "dummy")
|
||||||
.put("cloud.azure.service_name", "dummy")
|
.put("cloud.azure.service_name", "dummy")
|
||||||
.put("cloud.azure.refresh_interval", "5s")
|
.put("cloud.azure.refresh_interval", "5s")
|
||||||
|
// We need the network to make the mock working
|
||||||
|
.put("node.mode", "network")
|
||||||
// Make the tests run faster
|
// Make the tests run faster
|
||||||
.put("discovery.zen.join.timeout", "100ms")
|
.put("discovery.zen.join.timeout", "100ms")
|
||||||
.put("discovery.zen.ping.timeout", "10ms")
|
.put("discovery.zen.ping.timeout", "10ms")
|
||||||
|
|
|
@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.nullValue;
|
||||||
* Reported issue in #15
|
* Reported issue in #15
|
||||||
* (https://github.com/elasticsearch/elasticsearch-cloud-azure/issues/15)
|
* (https://github.com/elasticsearch/elasticsearch-cloud-azure/issues/15)
|
||||||
*/
|
*/
|
||||||
@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST,
|
@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.SUITE,
|
||||||
numDataNodes = 0,
|
numDataNodes = 0,
|
||||||
transportClientRatio = 0.0,
|
transportClientRatio = 0.0,
|
||||||
numClientNodes = 0)
|
numClientNodes = 0)
|
||||||
|
|
|
@ -47,7 +47,7 @@ import static org.hamcrest.Matchers.greaterThan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test needs Azure to run and -Dtests.azure=true to be set
|
* This test needs Azure to run and -Dtests.azure=true to be set
|
||||||
* and -Des.config=/path/to/elasticsearch.yml
|
* and -Dtests.config=/path/to/elasticsearch.yml
|
||||||
* @see org.elasticsearch.cloud.azure.AbstractAzureTest
|
* @see org.elasticsearch.cloud.azure.AbstractAzureTest
|
||||||
*/
|
*/
|
||||||
@AbstractAzureTest.AzureTest
|
@AbstractAzureTest.AzureTest
|
||||||
|
|
Loading…
Reference in New Issue