Skip to content

Commit

Permalink
Fix DistroTest dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
breskeby committed Jun 17, 2024
1 parent 040ad63 commit e1264d7
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,12 @@ public void apply(Project project) {

for (ElasticsearchDistribution distribution : testDistributions) {
String taskname = destructiveDistroTestTaskName(distribution);
TaskProvider<?> depsTask = project.getTasks().register(taskname + "#deps");
// explicitly depend on the archive not on the implicit extracted distribution
depsTask.configure(t -> t.dependsOn(examplePlugin.getDependencies()));
depsTasks.put(taskname, depsTask);
TaskProvider<Test> destructiveTask = configureTestTask(project, taskname, distribution, t -> {
t.onlyIf(t2 -> distribution.isDocker() == false || dockerSupport.get().getDockerAvailability().isAvailable);
addSysprop(t, DISTRIBUTION_SYSPROP, distribution::getFilepath);
addSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePlugin.getSingleFile().toString());
t.exclude("**/PackageUpgradeTests.class");
}, depsTask);
}, distribution, examplePlugin.getDependencies());

if (distribution.getPlatform() == Platform.WINDOWS) {
windowsTestTasks.add(destructiveTask);
Expand Down Expand Up @@ -158,14 +154,11 @@ public void apply(Project project) {

}
String upgradeTaskname = destructiveDistroUpgradeTestTaskName(distribution, version.toString());
TaskProvider<?> upgradeDepsTask = project.getTasks().register(upgradeTaskname + "#deps");
upgradeDepsTask.configure(t -> t.dependsOn(distribution, bwcDistro));
depsTasks.put(upgradeTaskname, upgradeDepsTask);
TaskProvider<Test> upgradeTest = configureTestTask(project, upgradeTaskname, distribution, t -> {
addSysprop(t, DISTRIBUTION_SYSPROP, distribution::getFilepath);
addSysprop(t, BWC_DISTRIBUTION_SYSPROP, bwcDistro::getFilepath);
t.include("**/PackageUpgradeTests.class");
}, upgradeDepsTask);
}, distribution, bwcDistro);
versionTasks.get(version.toString()).configure(t -> t.dependsOn(upgradeTest));
upgradeTestTasks.computeIfAbsent(version.toString(), k -> new ArrayList<>()).add(upgradeTest);
}
Expand Down

0 comments on commit e1264d7

Please sign in to comment.