From 81aa67f9d5ffc7248bb48ba2b1753966e97ab0bd Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 23 Aug 2016 16:12:35 -0700 Subject: [PATCH] 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. --- .../gradle/test/ClusterFormationTasks.groovy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index b1f07265019..8819c63080a 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -72,10 +72,9 @@ class ClusterFormationTasks { throw new GradleException("bwcVersion must not be null if numBwcNodes is > 0") } // this is our current version distribution configuration we use for all kinds of REST tests etc. - project.configurations { - elasticsearchDistro - } - configureDistributionDependency(project, config.distribution, project.configurations.elasticsearchDistro, VersionProperties.elasticsearch) + String distroConfigName = "${task.name}_elasticsearchDistro" + Configuration distro = project.configurations.create(distroConfigName) + configureDistributionDependency(project, config.distribution, distro, VersionProperties.elasticsearch) if (config.bwcVersion != null && config.numBwcNodes > 0) { // if we have a cluster that has a BWC cluster we also need to configure a dependency on the BWC version // this version uses the same distribution etc. and only differs in the version we depend on. @@ -91,10 +90,9 @@ class ClusterFormationTasks { // we start N nodes and out of these N nodes there might be M bwc nodes. // for each of those nodes we might have a different configuratioon String elasticsearchVersion = VersionProperties.elasticsearch - Configuration configuration = project.configurations.elasticsearchDistro if (i < config.numBwcNodes) { elasticsearchVersion = config.bwcVersion - configuration = project.configurations.elasticsearchBwcDistro + distro = project.configurations.elasticsearchBwcDistro } NodeInfo node = new NodeInfo(config, i, project, task, elasticsearchVersion, sharedDir) if (i == 0) { @@ -105,7 +103,7 @@ class ClusterFormationTasks { config.seedNodePortsFile = node.transportPortsFile; } nodes.add(node) - startTasks.add(configureNode(project, task, cleanup, node, configuration)) + startTasks.add(configureNode(project, task, cleanup, node, distro)) } Task wait = configureWaitTask("${task.name}#wait", project, nodes, startTasks)