Skip to content

Commit 13c60e4

Browse files
committed
Tests: update to Lucene 4.9.0
Closes #24.
1 parent f5b444e commit 13c60e4

File tree

6 files changed

+36
-29
lines changed

6 files changed

+36
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ Replaces `account`, `key` with your settings. Please, note that the test will de
414414
To run test:
415415

416416
```sh
417-
mvn -Dtests.azure=true -Des.config=/path/to/config/file/elasticsearch.yml clean test
417+
mvn -Dtests.azure=true -Dtests.config=/path/to/config/file/elasticsearch.yml clean test
418418
```
419419

420420

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ governing permissions and limitations under the License. -->
4343
</parent>
4444

4545
<properties>
46-
<elasticsearch.version>1.3.0-SNAPSHOT</elasticsearch.version>
47-
<lucene.version>4.8.1</lucene.version>
46+
<elasticsearch.version>1.3.1</elasticsearch.version>
47+
<lucene.version>4.9.0</lucene.version>
4848
<tests.output>onerror</tests.output>
4949
<tests.shuffle>true</tests.shuffle>
5050
<tests.output>onerror</tests.output>
@@ -203,7 +203,7 @@ governing permissions and limitations under the License. -->
203203
<tests.integration>${tests.integration}</tests.integration>
204204
<tests.cluster_seed>${tests.cluster_seed}</tests.cluster_seed>
205205
<tests.client.ratio>${tests.client.ratio}</tests.client.ratio>
206-
<es.config>${es.config}</es.config>
206+
<tests.config>${tests.config}</tests.config>
207207
<es.logger.level>${es.logger.level}</es.logger.level>
208208
<java.awt.headless>true</java.awt.headless>
209209
</systemProperties>

src/test/java/org/elasticsearch/cloud/azure/AbstractAzureTest.java

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
package org.elasticsearch.cloud.azure;
2121

2222
import com.carrotsearch.randomizedtesting.annotations.TestGroup;
23+
import org.elasticsearch.common.Strings;
24+
import org.elasticsearch.common.settings.ImmutableSettings;
25+
import org.elasticsearch.common.settings.Settings;
26+
import org.elasticsearch.env.Environment;
27+
import org.elasticsearch.env.FailedToResolveConfigException;
28+
import org.elasticsearch.plugins.PluginsService;
2329
import org.elasticsearch.test.ElasticsearchIntegrationTest;
2430

2531
import java.lang.annotation.Documented;
@@ -34,27 +40,7 @@ public abstract class AbstractAzureTest extends ElasticsearchIntegrationTest {
3440

3541
/**
3642
* Annotation for tests that require Azure to run. Azure tests are disabled by default.
37-
* <p/>
38-
* To enable test add -Dtests.azure=true -Des.config=/path/to/elasticsearch.yml
39-
* <p/>
40-
* The elasticsearch.yml file should contain the following keys
41-
* <pre>
42-
cloud:
43-
azure:
44-
keystore: FULLPATH-TO-YOUR-KEYSTORE
45-
password: YOUR-PASSWORD
46-
subscription_id: YOUR-AZURE-SUBSCRIPTION-ID
47-
service_name: YOUR-AZURE-SERVICE-NAME
48-
49-
discovery:
50-
type: azure
51-
52-
repositories:
53-
azure:
54-
account: "yourstorageaccount"
55-
key: "storage key"
56-
container: "container name"
57-
* </pre>
43+
* See README file for details.
5844
*/
5945
@Documented
6046
@Inherited
@@ -67,4 +53,25 @@ public abstract class AbstractAzureTest extends ElasticsearchIntegrationTest {
6753
*/
6854
public static final String SYSPROP_AZURE = "tests.azure";
6955

56+
@Override
57+
protected Settings nodeSettings(int nodeOrdinal) {
58+
ImmutableSettings.Builder settings = ImmutableSettings.builder()
59+
.put(super.nodeSettings(nodeOrdinal))
60+
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true);
61+
62+
Environment environment = new Environment();
63+
64+
// if explicit, just load it and don't load from env
65+
try {
66+
if (Strings.hasText(System.getProperty("tests.config"))) {
67+
settings.loadFromUrl(environment.resolveConfig(System.getProperty("tests.config")));
68+
} else {
69+
fail("to run integration tests, you need to set -Dtest.azure=true and -Dtests.config=/path/to/elasticsearch.yml");
70+
}
71+
} catch (FailedToResolveConfigException exception) {
72+
fail("your test configuration file is incorrect: " + System.getProperty("tests.config"));
73+
}
74+
return settings.build();
75+
}
76+
7077
}

src/test/java/org/elasticsearch/discovery/azure/AbstractAzureComputeServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.elasticsearch.cloud.azure.AzureComputeService;
2525
import org.elasticsearch.common.settings.ImmutableSettings;
2626
import org.elasticsearch.common.settings.Settings;
27-
import org.elasticsearch.plugins.PluginsService;
2827

2928
public abstract class AbstractAzureComputeServiceTest extends AbstractAzureTest {
3029

@@ -44,7 +43,6 @@ protected void checkNumberOfNodes(int expected) {
4443

4544
protected Settings settingsBuilder() {
4645
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
47-
.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true)
4846
.put("discovery.type", "azure")
4947
.put("cloud.azure.api.impl", mock)
5048
// We add a fake subscription_id to start mock compute service
@@ -54,6 +52,8 @@ protected Settings settingsBuilder() {
5452
.put("cloud.azure.password", "dummy")
5553
.put("cloud.azure.service_name", "dummy")
5654
.put("cloud.azure.refresh_interval", "5s")
55+
// We need the network to make the mock working
56+
.put("node.mode", "network")
5757
// Make the tests run faster
5858
.put("discovery.zen.join.timeout", "100ms")
5959
.put("discovery.zen.ping.timeout", "10ms")

src/test/java/org/elasticsearch/discovery/azure/AzureMinimumMasterNodesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* Reported issue in #15
3535
* (https://github.com/elasticsearch/elasticsearch-cloud-azure/issues/15)
3636
*/
37-
@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST,
37+
@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.SUITE,
3838
numDataNodes = 0,
3939
transportClientRatio = 0.0,
4040
numClientNodes = 0)

src/test/java/org/elasticsearch/repositories/azure/AzureSnapshotRestoreITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
/**
4949
* This test needs Azure to run and -Dtests.azure=true to be set
50-
* and -Des.config=/path/to/elasticsearch.yml
50+
* and -Dtests.config=/path/to/elasticsearch.yml
5151
* @see org.elasticsearch.cloud.azure.AbstractAzureTest
5252
*/
5353
@AbstractAzureTest.AzureTest

0 commit comments

Comments
 (0)