Add destructiveDistroTest meta task (#45762)

This commit adds a destructiveDistroTest task which depends on all of
the distribution specific destructive tasks, which can be used by CI.

closes #45769
This commit is contained in:
Ryan Ernst 2019-08-21 11:25:10 -07:00 committed by Ryan Ernst
parent 790765d3f9
commit 2b8d79c470
1 changed files with 4 additions and 3 deletions

View File

@ -95,10 +95,12 @@ public class DistroTestPlugin implements Plugin<Project> {
TaskProvider<Copy> copyUpgradeTask = configureCopyUpgradeTask(project, upgradeVersion, upgradeDir); TaskProvider<Copy> copyUpgradeTask = configureCopyUpgradeTask(project, upgradeVersion, upgradeDir);
TaskProvider<Copy> copyPluginsTask = configureCopyPluginsTask(project, pluginsDir); TaskProvider<Copy> copyPluginsTask = configureCopyPluginsTask(project, pluginsDir);
Map<String, TaskProvider<?>> batsTests = new HashMap<>(); TaskProvider<Task> destructiveDistroTest = project.getTasks().register("destructiveDistroTest");
for (ElasticsearchDistribution distribution : distributions) { for (ElasticsearchDistribution distribution : distributions) {
configureDistroTest(project, distribution); TaskProvider<?> destructiveTask = configureDistroTest(project, distribution);
destructiveDistroTest.configure(t -> t.dependsOn(destructiveTask));
} }
Map<String, TaskProvider<?>> batsTests = new HashMap<>();
batsTests.put("bats oss", configureBatsTest(project, "oss", distributionsDir, copyDistributionsTask)); batsTests.put("bats oss", configureBatsTest(project, "oss", distributionsDir, copyDistributionsTask));
batsTests.put("bats default", configureBatsTest(project, "default", distributionsDir, copyDistributionsTask)); batsTests.put("bats default", configureBatsTest(project, "default", distributionsDir, copyDistributionsTask));
configureBatsTest(project, "plugins",distributionsDir, copyDistributionsTask, copyPluginsTask).configure(t -> configureBatsTest(project, "plugins",distributionsDir, copyDistributionsTask, copyPluginsTask).configure(t ->
@ -126,7 +128,6 @@ public class DistroTestPlugin implements Plugin<Project> {
} }
} }
batsTests.forEach((desc, task) -> { batsTests.forEach((desc, task) -> {
configureVMWrapperTask(vmProject, desc, task.getName(), vmDependencies).configure(t -> { configureVMWrapperTask(vmProject, desc, task.getName(), vmDependencies).configure(t -> {
t.setProgressHandler(new BatsProgressLogger(project.getLogger())); t.setProgressHandler(new BatsProgressLogger(project.getLogger()));