OpenSearch/qa/rolling-upgrade/build.gradle

76 lines
2.8 KiB
Groovy

/*
* 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.
*/
import org.elasticsearch.gradle.test.RestIntegTestTask
apply plugin: 'elasticsearch.standalone-test'
task oldClusterTest(type: RestIntegTestTask) {
mustRunAfter(precommit)
cluster {
distribution = 'zip'
// TODO: Right now, this just forms a cluster with the current version of ES,
// because we don't support clusters with nodes on different alpha/beta releases of ES.
// When the GA is released, we should change the bwcVersion to 5.0.0 and uncomment
// numBwcNodes = 2
//bwcVersion = '5.0.0-alpha5' // TODO: either randomize, or make this settable with sysprop
//numBwcNodes = 2
numNodes = 2
clusterName = 'rolling-upgrade'
stopNodesOnCompletion = false
}
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.rest.preserve_indices', 'true'
}
task mixedClusterTest(type: RestIntegTestTask) {
dependsOn(oldClusterTest, 'oldClusterTest#node1.stop')
cluster {
distribution = 'zip'
clusterName = 'rolling-upgrade'
unicastTransportUri = { seedNode, node, ant -> oldClusterTest.nodes.get(0).transportUri() }
dataDir = "${-> oldClusterTest.nodes[1].dataDir}"
stopNodesOnCompletion = false
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.rest.preserve_indices', 'true'
}
task upgradedClusterTest(type: RestIntegTestTask) {
dependsOn(mixedClusterTest, 'oldClusterTest#node0.stop')
cluster {
distribution = 'zip'
clusterName = 'rolling-upgrade'
unicastTransportUri = { seedNode, node, ant -> mixedClusterTest.nodes.get(0).transportUri() }
dataDir = "${-> oldClusterTest.nodes[0].dataDir}"
}
systemProperty 'tests.rest.suite', 'upgraded_cluster'
}
// only need to kill the mixed cluster tests node here because we explicitly told it to not stop nodes upon completion
upgradedClusterTest.finalizedBy 'mixedClusterTest#stop'
task integTest {
dependsOn = [upgradedClusterTest]
}
test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
check.dependsOn(integTest)