mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-13 08:25:26 +00:00
This commit includes a number of changes to reduce overall build configuration time. These optimizations include: - Removing the usage of the 'nebula.info-scm' plugin. This plugin leverages jgit to load read various pieces of VCS information. This is mostly overkill and we have our own minimal implementation for determining the current commit id. - Removing unnecessary build dependencies such as perforce and jgit now that we don't need them. This reduces our classpath considerably. - Expanding the usage lazy task creation, particularly in our distribution projects. The archives and packages projects create lots of tasks with very complex configuration. Avoiding the creation of these tasks at configuration time gives us a nice boost.
97 lines
3.7 KiB
Groovy
97 lines
3.7 KiB
Groovy
import org.elasticsearch.gradle.Version
|
|
import org.elasticsearch.gradle.testclusters.RestTestRunnerTask
|
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
|
apply plugin: 'elasticsearch.standalone-test'
|
|
apply from : "$rootDir/gradle/bwc-test.gradle"
|
|
|
|
dependencies {
|
|
testCompile project(':x-pack:qa')
|
|
}
|
|
|
|
for (Version bwcVersion : bwcVersions.wireCompatible) {
|
|
String baseName = "v${bwcVersion}"
|
|
|
|
testClusters {
|
|
"${baseName}-leader" {
|
|
numberOfNodes = 3
|
|
}
|
|
"${baseName}-follower" {
|
|
numberOfNodes = 3
|
|
}
|
|
}
|
|
testClusters.matching { it.name.startsWith(baseName) }.all {
|
|
testDistribution = "DEFAULT"
|
|
versions = [bwcVersion.toString(), project.version]
|
|
|
|
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
|
|
setting 'xpack.security.enabled', 'false'
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
setting 'xpack.ml.enabled', 'false'
|
|
setting 'xpack.watcher.enabled', 'false'
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
}
|
|
|
|
tasks.withType(RestTestRunnerTask).matching { it.name.startsWith(baseName) }.all {
|
|
useCluster testClusters."${baseName}-leader"
|
|
useCluster testClusters."${baseName}-follower"
|
|
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
|
|
|
doFirst {
|
|
if (name.endsWith("#clusterTest") == false) {
|
|
println "Upgrade node $it"
|
|
testClusters."${baseName}-${kindExt}".nextNodeToNextVersion()
|
|
}
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",")}")
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName()}")
|
|
nonInputProperties.systemProperty('tests.leader_host', "${-> testClusters."${baseName}-leader".allHttpSocketURI.last()}")
|
|
nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', "${-> testClusters."${baseName}-leader".allTransportPortURI.last()}")
|
|
nonInputProperties.systemProperty('tests.follower_host', "${-> testClusters."${baseName}-follower".allHttpSocketURI.last()}")
|
|
nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', "${-> testClusters."${baseName}-follower".allTransportPortURI.last()}")
|
|
}
|
|
}
|
|
|
|
for (kind in ["follower", "leader"]) {
|
|
// Attention!! Groovy trap: do not pass `kind` to a closure
|
|
|
|
tasks.create("${baseName}#${kind}#clusterTest", RestTestRunnerTask) {
|
|
systemProperty 'tests.rest.upgrade_state', 'none'
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
ext.kindExt = kind
|
|
}
|
|
|
|
tasks.create("${baseName}#${kind}#oneThirdUpgradedTest", RestTestRunnerTask) {
|
|
systemProperty 'tests.rest.upgrade_state', 'one_third'
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
dependsOn "${baseName}#leader#clusterTest", "${baseName}#follower#clusterTest"
|
|
ext.kindExt = kind
|
|
}
|
|
|
|
tasks.create("${baseName}#${kind}#twoThirdsUpgradedTest", RestTestRunnerTask) {
|
|
systemProperty 'tests.rest.upgrade_state', 'two_third'
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
dependsOn "${baseName}#${kind}#oneThirdUpgradedTest"
|
|
ext.kindExt = kind
|
|
}
|
|
|
|
tasks.create("${baseName}#${kind}#upgradedClusterTest", RestTestRunnerTask) {
|
|
systemProperty 'tests.rest.upgrade_state', 'all'
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
dependsOn "${baseName}#${kind}#twoThirdsUpgradedTest"
|
|
ext.kindExt = kind
|
|
}
|
|
}
|
|
|
|
tasks.named("${baseName}#follower#clusterTest") {
|
|
dependsOn "${baseName}#leader#clusterTest"
|
|
}
|
|
|
|
tasks.named("${baseName}#leader#oneThirdUpgradedTest") {
|
|
dependsOn "${baseName}#follower#upgradedClusterTest"
|
|
}
|
|
|
|
tasks.register(bwcTaskName(bwcVersion)) {
|
|
dependsOn "${baseName}#leader#upgradedClusterTest"
|
|
}
|
|
}
|