Skip to content

Commit

Permalink
ElasticReindexIT: Add tests against Elasticsearch version 5
Browse files Browse the repository at this point in the history
Bug: Issue 6094
Change-Id: I324d099ee4cc484fcdfea8679e38cc2d3d2b5905
  • Loading branch information
dpursehouse committed Jun 4, 2018
1 parent 8c058bf commit 1492e86
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.google.gerrit.acceptance.pgm;

import com.google.gerrit.acceptance.NoHttpd;
import com.google.gerrit.elasticsearch.ElasticVersion;
import com.google.gerrit.elasticsearch.testing.ElasticContainer;
import com.google.gerrit.elasticsearch.testing.ElasticTestUtils;
import com.google.gerrit.elasticsearch.testing.ElasticTestUtils.ElasticNodeInfo;
Expand All @@ -28,11 +29,10 @@
public class ElasticReindexIT extends AbstractReindexTests {
private static ElasticContainer<?> container;

@ConfigSuite.Default
public static Config elasticsearch() {
private static Config getConfig(ElasticVersion version) {
ElasticNodeInfo elasticNodeInfo;
try {
container = ElasticContainer.createAndStart();
container = ElasticContainer.createAndStart(version);
elasticNodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());
} catch (Throwable t) {
return null;
Expand All @@ -43,6 +43,16 @@ public static Config elasticsearch() {
return cfg;
}

@ConfigSuite.Default
public static Config elasticsearchV2() {
return getConfig(ElasticVersion.V2_4);
}

@ConfigSuite.Config
public static Config elasticsearchV5() {
return getConfig(ElasticVersion.V5_6);
}

@Override
public void configureIndex(Injector injector) throws Exception {
ElasticTestUtils.createAllIndexes(injector);
Expand Down

0 comments on commit 1492e86

Please sign in to comment.