2016-09-02 11:10:17 -04:00
|
|
|
/*
|
|
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
|
|
* license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright
|
|
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2016-08-31 19:45:03 -04:00
|
|
|
|
|
|
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
|
|
|
|
2016-09-06 18:51:14 -04:00
|
|
|
apply plugin: 'elasticsearch.standalone-test'
|
|
|
|
|
|
|
|
task oldClusterTest(type: RestIntegTestTask) {
|
2016-08-31 19:45:03 -04:00
|
|
|
mustRunAfter(precommit)
|
|
|
|
cluster {
|
|
|
|
distribution = 'zip'
|
2017-02-15 10:59:24 -05:00
|
|
|
bwcVersion = '5.4.0-SNAPSHOT' // TODO: either randomize, or make this settable with sysprop
|
2016-11-22 14:56:34 -05:00
|
|
|
numBwcNodes = 2
|
2016-09-06 18:51:14 -04:00
|
|
|
numNodes = 2
|
2016-08-31 19:45:03 -04:00
|
|
|
clusterName = 'rolling-upgrade'
|
2017-01-25 18:09:25 -05:00
|
|
|
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
|
|
|
systemProperty 'tests.rest.suite', 'old_cluster'
|
|
|
|
}
|
|
|
|
|
|
|
|
task mixedClusterTest(type: RestIntegTestTask) {
|
2016-09-06 18:51:14 -04:00
|
|
|
dependsOn(oldClusterTest, 'oldClusterTest#node1.stop')
|
2016-08-31 19:45:03 -04:00
|
|
|
cluster {
|
|
|
|
distribution = 'zip'
|
|
|
|
clusterName = 'rolling-upgrade'
|
2016-09-06 18:51:14 -04:00
|
|
|
unicastTransportUri = { seedNode, node, ant -> oldClusterTest.nodes.get(0).transportUri() }
|
2016-09-13 12:36:20 -04:00
|
|
|
dataDir = "${-> oldClusterTest.nodes[1].dataDir}"
|
2017-01-25 18:09:25 -05:00
|
|
|
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
|
|
|
systemProperty 'tests.rest.suite', 'mixed_cluster'
|
2016-09-16 16:32:43 -04:00
|
|
|
finalizedBy 'oldClusterTest#node0.stop'
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
task upgradedClusterTest(type: RestIntegTestTask) {
|
2016-09-06 18:51:14 -04:00
|
|
|
dependsOn(mixedClusterTest, 'oldClusterTest#node0.stop')
|
2016-08-31 19:45:03 -04:00
|
|
|
cluster {
|
|
|
|
distribution = 'zip'
|
|
|
|
clusterName = 'rolling-upgrade'
|
2016-09-06 18:51:14 -04:00
|
|
|
unicastTransportUri = { seedNode, node, ant -> mixedClusterTest.nodes.get(0).transportUri() }
|
2016-09-13 12:36:20 -04:00
|
|
|
dataDir = "${-> oldClusterTest.nodes[0].dataDir}"
|
2017-01-25 18:09:25 -05:00
|
|
|
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
|
|
|
systemProperty 'tests.rest.suite', 'upgraded_cluster'
|
2016-09-16 16:32:43 -04:00
|
|
|
// only need to kill the mixed cluster tests node here because we explicitly told it to not stop nodes upon completion
|
|
|
|
finalizedBy 'mixedClusterTest#stop'
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
task integTest {
|
2016-09-16 10:14:51 -04:00
|
|
|
dependsOn = [upgradedClusterTest]
|
2016-08-31 19:45:03 -04:00
|
|
|
}
|
2016-09-16 11:32:28 -04:00
|
|
|
|
|
|
|
test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
|
|
|
|
|
2016-08-31 19:45:03 -04:00
|
|
|
check.dependsOn(integTest)
|
2016-11-14 08:26:49 -05:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
|
|
}
|
|
|
|
}
|