Skip to content

Commit 0b99670

Browse files
authored
Migrate mapper-related modules to internal-*-rest-test (#117298) (#117406)
(cherry picked from commit 2b8e4e7) # Conflicts: # modules/mapper-extras/build.gradle # plugins/mapper-annotated-text/build.gradle # plugins/mapper-murmur3/build.gradle # x-pack/plugin/mapper-unsigned-long/build.gradle # x-pack/plugin/mapper-version/build.gradle # x-pack/plugin/wildcard/build.gradle
1 parent 2e03eaf commit 0b99670

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
@@ -9,8 +9,8 @@
99

1010
import org.elasticsearch.gradle.internal.info.BuildParams
1111

12-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
13-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
12+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
13+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1414
apply plugin: 'elasticsearch.internal-cluster-test'
1515

1616
esplugin {
@@ -23,9 +23,3 @@ restResources {
2323
include '_common', 'cluster', 'field_caps', 'nodes', 'indices', 'index', 'search', 'get'
2424
}
2525
}
26-
27-
if (BuildParams.isSnapshotBuild() == false) {
28-
tasks.named("test").configure {
29-
systemProperty 'es.index_mode_feature_flag_registered', 'true'
30-
}
31-
}

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
@@ -16,9 +16,9 @@ import org.elasticsearch.gradle.transform.UnzipTransform
1616

1717
apply plugin: 'elasticsearch.test-with-dependencies'
1818
apply plugin: 'elasticsearch.jdk-download'
19-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
19+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
2020
apply plugin: 'elasticsearch.legacy-java-rest-test'
21-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
21+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
2222
apply plugin: 'elasticsearch.internal-cluster-test'
2323

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

3938
dependencies {
@@ -42,6 +41,10 @@ dependencies {
4241
// for parent/child testing
4342
testImplementation project(':modules:parent-join')
4443
testImplementation project(':modules:rest-root')
44+
45+
clusterModules project(':modules:lang-painless')
46+
clusterModules project(':modules:parent-join')
47+
clusterModules project(":modules:rest-root")
4548
}
4649

4750
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
@@ -8,20 +8,14 @@ import org.elasticsearch.gradle.internal.info.BuildParams
88
* your election, the "Elastic License 2.0", the "GNU Affero General Public
99
* License v3.0 only", or the "Server Side Public License, v 1".
1010
*/
11-
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
12-
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
11+
apply plugin: 'elasticsearch.internal-yaml-rest-test'
12+
apply plugin: 'elasticsearch.yaml-rest-compat-test'
1313

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

19-
if (BuildParams.isSnapshotBuild() == false) {
20-
tasks.named("test").configure {
21-
systemProperty 'es.index_mode_feature_flag_registered', 'true'
22-
}
23-
}
24-
2519
restResources {
2620
restApi {
2721
include '_common', 'indices', 'index', 'search'

0 commit comments

Comments
 (0)