Skip to content

Commit

Permalink
Revert "Add Watcher to available rest resources (#53319)"
Browse files Browse the repository at this point in the history
This reverts commit 887541e.
  • Loading branch information
jakelandis committed Mar 16, 2020
1 parent 887541e commit 4f48e05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void copy() {
if (BuildParams.isInternal()) {
getLogger().debug("Rest tests for project [{}] will be copied to the test resources.", project.getPath());
project.copy(c -> {
c.from(coreConfig.getAsFileTree());
c.from(coreConfig.getSingleFile());
c.into(getOutputDir());
c.include(corePatternSet.getIncludes());
});
Expand All @@ -138,7 +138,7 @@ void copy() {
if (includeXpack.get().isEmpty() == false) {
getLogger().debug("X-pack rest tests for project [{}] will be copied to the test resources.", project.getPath());
project.copy(c -> {
c.from(xpackConfig.getAsFileTree());
c.from(xpackConfig.getSingleFile());
c.into(getOutputDir());
c.include(xpackPatternSet.getIncludes());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,21 @@ public class RestResourcesPlugin implements Plugin<Project> {
public void apply(Project project) {
RestResourcesExtension extension = project.getExtensions().create(EXTENSION_NAME, RestResourcesExtension.class);

// tests
Provider<CopyRestTestsTask> copyRestYamlTestTask = project.getTasks()
.register("copyYamlTestsTask", CopyRestTestsTask.class, task -> {
task.includeCore.set(extension.restTests.getIncludeCore());
task.includeXpack.set(extension.restTests.getIncludeXpack());
task.coreConfig = project.getConfigurations().maybeCreate("restTests");
task.coreConfig = project.getConfigurations().create("restTest");
if (BuildParams.isInternal()) {
// core
Dependency restTestdependency = project.getDependencies()
.project(Map.of("path", ":rest-api-spec", "configuration", "restTests"));
project.getDependencies().add(task.coreConfig.getName(), restTestdependency);
// x-pack
task.xpackConfig = project.getConfigurations().maybeCreate("restXpackTests");

task.xpackConfig = project.getConfigurations().create("restXpackTest");
Dependency restXPackTestdependency = project.getDependencies()
.project(Map.of("path", ":x-pack:plugin", "configuration", "restXpackTests"));
project.getDependencies().add(task.xpackConfig.getName(), restXPackTestdependency);
task.dependsOn(task.xpackConfig);
// watcher
Dependency restWatcherTests = project.getDependencies()
.project(Map.of("path", ":x-pack:plugin:watcher:qa:rest", "configuration", "restXpackTests"));
project.getDependencies().add(task.xpackConfig.getName(), restWatcherTests);
} else {
Dependency dependency = project.getDependencies()
.create("org.elasticsearch:rest-api-spec:" + VersionProperties.getElasticsearch());
Expand All @@ -115,19 +109,18 @@ public void apply(Project project) {
task.dependsOn(task.coreConfig);
});

// api
Provider<CopyRestApiTask> copyRestYamlSpecTask = project.getTasks()
.register("copyRestApiSpecsTask", CopyRestApiTask.class, task -> {
task.includeCore.set(extension.restApi.getIncludeCore());
task.includeXpack.set(extension.restApi.getIncludeXpack());
task.dependsOn(copyRestYamlTestTask);
task.coreConfig = project.getConfigurations().maybeCreate("restSpecs");
task.coreConfig = project.getConfigurations().create("restSpec");
if (BuildParams.isInternal()) {
Dependency restSpecDependency = project.getDependencies()
.project(Map.of("path", ":rest-api-spec", "configuration", "restSpecs"));
project.getDependencies().add(task.coreConfig.getName(), restSpecDependency);

task.xpackConfig = project.getConfigurations().maybeCreate("restXpackSpecs");
task.xpackConfig = project.getConfigurations().create("restXpackSpec");
Dependency restXpackSpecDependency = project.getDependencies()
.project(Map.of("path", ":x-pack:plugin", "configuration", "restXpackSpecs"));
project.getDependencies().add(task.xpackConfig.getName(), restXpackSpecDependency);
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugin/watcher/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {

configurations {
testArtifacts.extendsFrom testRuntime
restXpackTests
}

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

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

restResources {
Expand Down
12 changes: 9 additions & 3 deletions x-pack/plugin/watcher/qa/with-security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ dependencies {
testCompile project(path: ':x-pack:plugin:watcher:qa:rest', configuration: 'testArtifacts')
}


// bring in watcher rest test suite from the rest project
task copyWatcherRestTests(type: Copy) {
into project.sourceSets.test.output.resourcesDir
from project(xpackProject('plugin:watcher:qa:rest').path).sourceSets.test.resources.srcDirs
include 'rest-api-spec/test/watcher/**'
}

restResources {
restApi {
includeXpack 'watcher', 'security', 'xpack'
}
restTests {
includeXpack 'watcher'
}
}

integTest.runner.dependsOn copyWatcherRestTests
testClusters.integTest {
testDistribution = 'DEFAULT'
setting 'xpack.ilm.enabled', 'false'
Expand Down

0 comments on commit 4f48e05

Please sign in to comment.