-
Notifications
You must be signed in to change notification settings - Fork 25.1k
/
Copy pathbuild.gradle
120 lines (107 loc) · 4.99 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
apply plugin: 'elasticsearch.internal-testclusters'
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.bwc-test'
apply plugin: 'elasticsearch.rest-resources'
buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
/*
* NOTE: This module is for the tests that were problematic when converting :qa:rolling-upgrade to the junit-based bwc test definition
* Over time, these should be migrated into the :qa:rolling-upgrade module and fixed properly
*
* The goal here is to:
* <ul>
* <li>start three nodes on the old version
* <li>run tests with systemProperty 'tests.rest.suite', 'old_cluster'
* <li>upgrade one node
* <li>run tests with systemProperty 'tests.rest.suite', 'mixed_cluster'
* <li>upgrade one more node
* <li>run tests with systemProperty 'tests.rest.suite', 'mixed_cluster' again
* <li>updgrade the last node
* <li>run tests with systemProperty 'tests.rest.suite', 'upgraded_cluster'
* </ul>
*/
def baseCluster = testClusters.register(baseName) {
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 3
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
setting 'path.repo', "${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}"
setting 'xpack.security.enabled', 'false'
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}
String oldVersion = bwcVersion.toString()
tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) {
dependsOn "processTestResources"
useCluster baseCluster
mustRunAfter("precommit")
doFirst {
delete("${layout.buildDirectory.get().asFile}/cluster/shared/repo/${baseName}")
}
def excludeList = []
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}
tasks.register("${baseName}#oneThirdUpgradedTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#oldClusterTest"
useCluster baseCluster
doFirst {
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'true'
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}
tasks.register("${baseName}#twoThirdsUpgradedTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#oneThirdUpgradedTest"
useCluster baseCluster
doFirst {
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'false'
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#twoThirdsUpgradedTest"
doFirst {
getRegistry().get().nextNodeToNextVersion(baseCluster)
}
useCluster testClusters.named(baseName)
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', getClusterInfo(baseName).map { it.allHttpSocketURI.join(",") })
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}
tasks.register(bwcTaskName(bwcVersion)) {
dependsOn tasks.named("${baseName}#upgradedClusterTest")
}
}