|
@@ -1,25 +1,20 @@
|
|
|
|
|
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
|
|
+import org.elasticsearch.gradle.testclusters.TestClustersPlugin
|
|
|
|
|
|
subprojects { Project subproj ->
|
|
|
subproj.tasks.withType(RestIntegTestTask) {
|
|
|
- subproj.extensions.configure("${it.name}Cluster") { cluster ->
|
|
|
- cluster.distribution = System.getProperty('tests.distribution', 'oss')
|
|
|
- if (cluster.distribution == 'default') {
|
|
|
- /*
|
|
|
- * Add Elastic's repositories so we can resolve older versions of the
|
|
|
- * default distribution. Those aren't in maven central.
|
|
|
- */
|
|
|
- repositories {
|
|
|
- maven {
|
|
|
- name "elastic"
|
|
|
- url "https://artifacts.elastic.co/maven"
|
|
|
- }
|
|
|
- maven {
|
|
|
- name "elastic-snapshots"
|
|
|
- url "https://snapshots.elastic.co/maven"
|
|
|
- }
|
|
|
- }
|
|
|
+ if (subproj.extensions.findByName("${it.name}Cluster")) {
|
|
|
+ subproj.extensions.configure("${it.name}Cluster") { cluster ->
|
|
|
+ cluster.distribution = System.getProperty('tests.distribution', 'oss')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ plugins.withType(TestClustersPlugin).whenPluginAdded {
|
|
|
+ afterEvaluate {
|
|
|
+ // We need to delay this so it's not overwritten in RestIntegTestTask
|
|
|
+ testClusters.all {
|
|
|
+ distribution = System.getProperty('tests.distribution', 'oss').toUpperCase()
|
|
|
}
|
|
|
}
|
|
|
}
|