Skip to content

Commit 2b8e4e7

Browse files
authored
Migrate mapper-related modules to internal-*-rest-test (#117298)
1 parent 0d1979e commit 2b8e4e7

File tree

19 files changed

+118
-63
lines changed

19 files changed

+118
-63
lines changed

modules/mapper-extras/build.gradle

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
11-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
10+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
11+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1212
apply plugin: 'elasticsearch.internal-cluster-test'
1313

1414
esplugin {
@@ -21,9 +21,3 @@ restResources {
2121
include '_common', 'cluster', 'field_caps', 'nodes', 'indices', 'index', 'search', 'get'
2222
}
2323
}
24-
25-
if (buildParams.isSnapshotBuild() == false) {
26-
tasks.named("test").configure {
27-
systemProperty 'es.index_mode_feature_flag_registered', 'true'
28-
}
29-
}

modules/mapper-extras/src/yamlRestTest/java/org/elasticsearch/index/mapper/MapperExtrasClientYamlTestSuiteIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1414

15+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1516
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1617
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
18+
import org.junit.ClassRule;
1719

1820
/** Runs yaml rest tests */
1921
public class MapperExtrasClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
@@ -26,4 +28,12 @@ public MapperExtrasClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate t
2628
public static Iterable<Object[]> parameters() throws Exception {
2729
return ESClientYamlSuiteTestCase.createParameters();
2830
}
31+
32+
@ClassRule
33+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("mapper-extras").build();
34+
35+
@Override
36+
protected String getTestRestCluster() {
37+
return cluster.getHttpAddresses();
38+
}
2939
}

modules/parent-join/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
10-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
9+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
10+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1111
apply plugin: 'elasticsearch.internal-cluster-test'
1212

1313
esplugin {

modules/parent-join/src/yamlRestTest/java/org/elasticsearch/join/ParentChildClientYamlTestSuiteIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1414

15+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1516
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1617
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
18+
import org.junit.ClassRule;
1719

1820
public class ParentChildClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
1921
public ParentChildClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
@@ -24,4 +26,12 @@ public ParentChildClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate te
2426
public static Iterable<Object[]> parameters() throws Exception {
2527
return createParameters();
2628
}
29+
30+
@ClassRule
31+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("parent-join").build();
32+
33+
@Override
34+
protected String getTestRestCluster() {
35+
return cluster.getHttpAddresses();
36+
}
2737
}

modules/percolator/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
10-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
9+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
10+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1111
apply plugin: 'elasticsearch.internal-cluster-test'
1212

1313
esplugin {

modules/percolator/src/yamlRestTest/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1414

15+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1516
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1617
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
18+
import org.junit.ClassRule;
1719

1820
public class PercolatorClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
1921
public PercolatorClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
@@ -24,4 +26,12 @@ public PercolatorClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate tes
2426
public static Iterable<Object[]> parameters() throws Exception {
2527
return ESClientYamlSuiteTestCase.createParameters();
2628
}
29+
30+
@ClassRule
31+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("percolator").build();
32+
33+
@Override
34+
protected String getTestRestCluster() {
35+
return cluster.getHttpAddresses();
36+
}
2737
}

modules/reindex/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import org.elasticsearch.gradle.transform.UnzipTransform
1515

1616
apply plugin: 'elasticsearch.test-with-dependencies'
1717
apply plugin: 'elasticsearch.jdk-download'
18-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
18+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
1919
apply plugin: 'elasticsearch.legacy-java-rest-test'
20-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
20+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
2121
apply plugin: 'elasticsearch.internal-cluster-test'
2222

2323
esplugin {
@@ -32,7 +32,6 @@ testClusters.configureEach {
3232
module ':modules:rest-root'
3333
// Whitelist reindexing from the local node so we can test reindex-from-remote.
3434
setting 'reindex.remote.whitelist', '127.0.0.1:*'
35-
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
3635
}
3736

3837
dependencies {
@@ -41,6 +40,10 @@ dependencies {
4140
// for parent/child testing
4241
testImplementation project(':modules:parent-join')
4342
testImplementation project(':modules:rest-root')
43+
44+
clusterModules project(':modules:lang-painless')
45+
clusterModules project(':modules:parent-join')
46+
clusterModules project(":modules:rest-root")
4447
}
4548

4649
restResources {

modules/reindex/src/javaRestTest/java/org/elasticsearch/index/reindex/ReindexWithoutContentIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import static org.hamcrest.CoreMatchers.containsString;
1919

2020
public class ReindexWithoutContentIT extends ESRestTestCase {
21-
2221
public void testReindexMissingBody() throws IOException {
2322
ResponseException responseException = expectThrows(
2423
ResponseException.class,

modules/reindex/src/yamlRestTest/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1414

15+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1516
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1617
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
18+
import org.junit.ClassRule;
1719

1820
public class ReindexClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
1921
public ReindexClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
@@ -24,4 +26,18 @@ public ReindexClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCa
2426
public static Iterable<Object[]> parameters() throws Exception {
2527
return ESClientYamlSuiteTestCase.createParameters();
2628
}
29+
30+
@ClassRule
31+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
32+
.module("reindex")
33+
.module("lang-painless")
34+
.module("parent-join")
35+
.module("rest-root")
36+
.setting("reindex.remote.whitelist", "127.0.0.1:*")
37+
.build();
38+
39+
@Override
40+
protected String getTestRestCluster() {
41+
return cluster.getHttpAddresses();
42+
}
2743
}

plugins/mapper-annotated-text/build.gradle

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
10-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
9+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
10+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1111

1212
esplugin {
1313
description 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.'
1414
classname 'org.elasticsearch.index.mapper.annotatedtext.AnnotatedTextPlugin'
1515
}
1616

17-
if (buildParams.isSnapshotBuild() == false) {
18-
tasks.named("test").configure {
19-
systemProperty 'es.index_mode_feature_flag_registered', 'true'
20-
}
21-
}
22-
2317
restResources {
2418
restApi {
2519
include '_common', 'indices', 'index', 'search'

0 commit comments

Comments
 (0)