@@ -75,7 +75,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
75
75
def baseCluster = testClusters. register(baseName) {
76
76
versions = [bwcVersion. toString(), project. version]
77
77
numberOfNodes = 4
78
- setting ' path.repo' , " ${ buildDir } /cluster/shared/repo/${ baseName} "
78
+ setting ' path.repo' , " ${ layout.buildDirectory.asFile.get() } /cluster/shared/repo/${ baseName} "
79
79
setting ' xpack.security.enabled' , ' false'
80
80
setting " xpack.license.self_generated.type" , " trial"
81
81
/* There is a chance we have more master changes than "normal", so to avoid this test from failing,
@@ -89,50 +89,32 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
89
89
tasks. register(" ${ baseName} #mixedClusterTest" , StandaloneRestIntegTestTask ) {
90
90
useCluster baseCluster
91
91
mustRunAfter(" precommit" )
92
- Provider<TestClustersRegistry > serviceProvider = GradleUtils . getBuildService(
93
- project. gradle. sharedServices,
94
- TestClustersPlugin . REGISTRY_SERVICE_NAME
95
- )
96
-
97
- def baseInfo = project. getProviders(). of(TestClusterValueSource . class) {
98
- it. parameters. path. set(clusterPath)
99
- it. parameters. clusterName. set(baseName)
100
- it. parameters. service = serviceProvider
101
- }. map { it. getAllHttpSocketURI() }
102
-
103
- def baseInfoAfterOneNodeUpdate = project. getProviders(). of(TestClusterValueSource . class) {
104
- it. parameters. path. set(clusterPath)
105
- it. parameters. clusterName. set(baseName)
106
- it. parameters. service = serviceProvider
107
- }. map { it. getAllHttpSocketURI() }
108
-
109
- def baseInfoAfterTwoNodesUpdate = project. getProviders(). of(TestClusterValueSource . class) {
110
- it. parameters. path. set(clusterPath)
111
- it. parameters. clusterName. set(baseName)
112
- it. parameters. service = serviceProvider
113
- }. map { it. getAllHttpSocketURI() }
114
- def nonInputProps = nonInputProperties
115
- def sharedRepoFolder = new File (buildDir, " cluster/shared/repo/${ baseName} " )
92
+ def baseInfo = getClusterInfo(baseName). map { it. allHttpSocketURI. join(" ," ) }
93
+ def baseInfoAfterOneNodeUpdate = getClusterInfo(baseName). map { it. allHttpSocketURI. join(" ," ) }
94
+ def baseInfoAfterTwoNodesUpdate = getClusterInfo(baseName). map { it. allHttpSocketURI. join(" ," ) }
95
+ def sharedRepoFolder = layout. buildDirectory. file(" cluster/shared/repo/${ baseName} " ). get(). asFile
116
96
doFirst {
117
97
delete(sharedRepoFolder)
118
98
// Getting the endpoints causes a wait for the cluster
119
99
println " Test cluster endpoints are: ${ -> baseInfo.get().join(",")} "
120
100
println " Upgrading one node to create a mixed cluster"
121
- baseCluster. get(). nextNodeToNextVersion()
101
+ getRegistry(). get(). nextNodeToNextVersion(baseCluster)
102
+
122
103
// Getting the endpoints causes a wait for the cluster
123
- println " Upgrade complete, endpoints are: ${ -> baseInfoAfterOneNodeUpdate.get().join(",") } "
104
+ println " Upgrade complete, endpoints are: ${ -> baseInfoAfterOneNodeUpdate.get()} "
124
105
println " Upgrading another node to create a mixed cluster"
125
- baseCluster. get(). nextNodeToNextVersion()
126
- nonInputProps. systemProperty(' tests.rest.cluster' , baseInfoAfterTwoNodesUpdate. map(c -> c. join(" ," )))
127
- nonInputProps. systemProperty(' tests.clustername' , baseName)
128
- if (excludeList. isEmpty() == false ) {
129
- systemProperty ' tests.rest.blacklist' , excludeList. join(' ,' )
130
- }
106
+ getRegistry(). get(). nextNodeToNextVersion(baseCluster)
107
+ }
108
+ if (excludeList. isEmpty() == false ) {
109
+ systemProperty ' tests.rest.blacklist' , excludeList. join(' ,' )
131
110
}
132
- systemProperty ' tests.path.repo' , " ${ buildDir} /cluster/shared/repo/${ baseName} "
111
+ nonInputProperties. systemProperty(' tests.rest.cluster' , baseInfoAfterTwoNodesUpdate)
112
+ nonInputProperties. systemProperty(' tests.clustername' , baseName)
113
+ systemProperty ' tests.path.repo' , " ${ layout.buildDirectory.file("cluster/shared/repo/${baseName}").get().asFile} "
133
114
systemProperty ' tests.bwc_nodes_version' , bwcVersion. toString(). replace(' -SNAPSHOT' , ' ' )
134
115
systemProperty ' tests.new_nodes_version' , project. version. toString(). replace(' -SNAPSHOT' , ' ' )
135
- // onlyIf("BWC tests disabled") { project.bwc_tests_enabled }
116
+ def bwcEnabled = project. bwc_tests_enabled
117
+ onlyIf(" BWC tests disabled" ) { bwcEnabled }
136
118
}
137
119
138
120
tasks. register(bwcTaskName(bwcVersion)) {
0 commit comments