Skip to content

Commit 81aa67f

Browse files
committed
Build: Allow plugin to set run configuration distro to zip
This was previously broken because run and integTest used the same configuration name. This change makes the configuration name prefixed by the task the cluster is created for.
1 parent 8563c8d commit 81aa67f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ class ClusterFormationTasks {
7272
throw new GradleException("bwcVersion must not be null if numBwcNodes is > 0")
7373
}
7474
// this is our current version distribution configuration we use for all kinds of REST tests etc.
75-
project.configurations {
76-
elasticsearchDistro
77-
}
78-
configureDistributionDependency(project, config.distribution, project.configurations.elasticsearchDistro, VersionProperties.elasticsearch)
75+
String distroConfigName = "${task.name}_elasticsearchDistro"
76+
Configuration distro = project.configurations.create(distroConfigName)
77+
configureDistributionDependency(project, config.distribution, distro, VersionProperties.elasticsearch)
7978
if (config.bwcVersion != null && config.numBwcNodes > 0) {
8079
// if we have a cluster that has a BWC cluster we also need to configure a dependency on the BWC version
8180
// this version uses the same distribution etc. and only differs in the version we depend on.
@@ -91,10 +90,9 @@ class ClusterFormationTasks {
9190
// we start N nodes and out of these N nodes there might be M bwc nodes.
9291
// for each of those nodes we might have a different configuratioon
9392
String elasticsearchVersion = VersionProperties.elasticsearch
94-
Configuration configuration = project.configurations.elasticsearchDistro
9593
if (i < config.numBwcNodes) {
9694
elasticsearchVersion = config.bwcVersion
97-
configuration = project.configurations.elasticsearchBwcDistro
95+
distro = project.configurations.elasticsearchBwcDistro
9896
}
9997
NodeInfo node = new NodeInfo(config, i, project, task, elasticsearchVersion, sharedDir)
10098
if (i == 0) {
@@ -105,7 +103,7 @@ class ClusterFormationTasks {
105103
config.seedNodePortsFile = node.transportPortsFile;
106104
}
107105
nodes.add(node)
108-
startTasks.add(configureNode(project, task, cleanup, node, configuration))
106+
startTasks.add(configureNode(project, task, cleanup, node, distro))
109107
}
110108

111109
Task wait = configureWaitTask("${task.name}#wait", project, nodes, startTasks)

0 commit comments

Comments
 (0)