Skip to content

Commit 4f48e05

Browse files
committed
Revert "Add Watcher to available rest resources (#53319)"
This reverts commit 887541e.
1 parent 887541e commit 4f48e05

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/CopyRestTestsTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void copy() {
114114
if (BuildParams.isInternal()) {
115115
getLogger().debug("Rest tests for project [{}] will be copied to the test resources.", project.getPath());
116116
project.copy(c -> {
117-
c.from(coreConfig.getAsFileTree());
117+
c.from(coreConfig.getSingleFile());
118118
c.into(getOutputDir());
119119
c.include(corePatternSet.getIncludes());
120120
});
@@ -138,7 +138,7 @@ void copy() {
138138
if (includeXpack.get().isEmpty() == false) {
139139
getLogger().debug("X-pack rest tests for project [{}] will be copied to the test resources.", project.getPath());
140140
project.copy(c -> {
141-
c.from(xpackConfig.getAsFileTree());
141+
c.from(xpackConfig.getSingleFile());
142142
c.into(getOutputDir());
143143
c.include(xpackPatternSet.getIncludes());
144144
});

buildSrc/src/main/java/org/elasticsearch/gradle/test/rest/RestResourcesPlugin.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,21 @@ public class RestResourcesPlugin implements Plugin<Project> {
8686
public void apply(Project project) {
8787
RestResourcesExtension extension = project.getExtensions().create(EXTENSION_NAME, RestResourcesExtension.class);
8888

89-
// tests
9089
Provider<CopyRestTestsTask> copyRestYamlTestTask = project.getTasks()
9190
.register("copyYamlTestsTask", CopyRestTestsTask.class, task -> {
9291
task.includeCore.set(extension.restTests.getIncludeCore());
9392
task.includeXpack.set(extension.restTests.getIncludeXpack());
94-
task.coreConfig = project.getConfigurations().maybeCreate("restTests");
93+
task.coreConfig = project.getConfigurations().create("restTest");
9594
if (BuildParams.isInternal()) {
96-
// core
9795
Dependency restTestdependency = project.getDependencies()
9896
.project(Map.of("path", ":rest-api-spec", "configuration", "restTests"));
9997
project.getDependencies().add(task.coreConfig.getName(), restTestdependency);
100-
// x-pack
101-
task.xpackConfig = project.getConfigurations().maybeCreate("restXpackTests");
98+
99+
task.xpackConfig = project.getConfigurations().create("restXpackTest");
102100
Dependency restXPackTestdependency = project.getDependencies()
103101
.project(Map.of("path", ":x-pack:plugin", "configuration", "restXpackTests"));
104102
project.getDependencies().add(task.xpackConfig.getName(), restXPackTestdependency);
105103
task.dependsOn(task.xpackConfig);
106-
// watcher
107-
Dependency restWatcherTests = project.getDependencies()
108-
.project(Map.of("path", ":x-pack:plugin:watcher:qa:rest", "configuration", "restXpackTests"));
109-
project.getDependencies().add(task.xpackConfig.getName(), restWatcherTests);
110104
} else {
111105
Dependency dependency = project.getDependencies()
112106
.create("org.elasticsearch:rest-api-spec:" + VersionProperties.getElasticsearch());
@@ -115,19 +109,18 @@ public void apply(Project project) {
115109
task.dependsOn(task.coreConfig);
116110
});
117111

118-
// api
119112
Provider<CopyRestApiTask> copyRestYamlSpecTask = project.getTasks()
120113
.register("copyRestApiSpecsTask", CopyRestApiTask.class, task -> {
121114
task.includeCore.set(extension.restApi.getIncludeCore());
122115
task.includeXpack.set(extension.restApi.getIncludeXpack());
123116
task.dependsOn(copyRestYamlTestTask);
124-
task.coreConfig = project.getConfigurations().maybeCreate("restSpecs");
117+
task.coreConfig = project.getConfigurations().create("restSpec");
125118
if (BuildParams.isInternal()) {
126119
Dependency restSpecDependency = project.getDependencies()
127120
.project(Map.of("path", ":rest-api-spec", "configuration", "restSpecs"));
128121
project.getDependencies().add(task.coreConfig.getName(), restSpecDependency);
129122

130-
task.xpackConfig = project.getConfigurations().maybeCreate("restXpackSpecs");
123+
task.xpackConfig = project.getConfigurations().create("restXpackSpec");
131124
Dependency restXpackSpecDependency = project.getDependencies()
132125
.project(Map.of("path", ":x-pack:plugin", "configuration", "restXpackSpecs"));
133126
project.getDependencies().add(task.xpackConfig.getName(), restXpackSpecDependency);

x-pack/plugin/watcher/qa/rest/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies {
88

99
configurations {
1010
testArtifacts.extendsFrom testRuntime
11-
restXpackTests
1211
}
1312

1413
task testJar(type: Jar) {
@@ -18,7 +17,6 @@ task testJar(type: Jar) {
1817

1918
artifacts {
2019
testArtifacts testJar
21-
restXpackTests(new File(projectDir, "src/test/resources/rest-api-spec/test"))
2220
}
2321

2422
restResources {

x-pack/plugin/watcher/qa/with-security/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ dependencies {
77
testCompile project(path: ':x-pack:plugin:watcher:qa:rest', configuration: 'testArtifacts')
88
}
99

10+
11+
// bring in watcher rest test suite from the rest project
12+
task copyWatcherRestTests(type: Copy) {
13+
into project.sourceSets.test.output.resourcesDir
14+
from project(xpackProject('plugin:watcher:qa:rest').path).sourceSets.test.resources.srcDirs
15+
include 'rest-api-spec/test/watcher/**'
16+
}
17+
1018
restResources {
1119
restApi {
1220
includeXpack 'watcher', 'security', 'xpack'
1321
}
14-
restTests {
15-
includeXpack 'watcher'
16-
}
1722
}
1823

24+
integTest.runner.dependsOn copyWatcherRestTests
1925
testClusters.integTest {
2026
testDistribution = 'DEFAULT'
2127
setting 'xpack.ilm.enabled', 'false'

0 commit comments

Comments
 (0)