@@ -351,20 +351,9 @@ def createJob( TEST_JOB_NAME, ARCH_OS ) {
351
351
}
352
352
353
353
def templatePath = ' aqa-tests/buildenv/jenkins/testJobTemplate'
354
- if (env. NODE_NAME ) {
355
- echo " ${ env.NODE_NAME} is allocated ..."
356
- if (! fileExists(templatePath)) {
357
- sh " curl -Os https://raw.githubusercontent.com/adoptium/aqa-tests/master/buildenv/jenkins/testJobTemplate"
358
- templatePath = ' testJobTemplate'
359
- }
360
- } else {
361
- echo " Node is not allocated ..."
362
- node {
363
- if (! fileExists(templatePath)) {
364
- sh " curl -Os https://raw.githubusercontent.com/adoptium/aqa-tests/master/buildenv/jenkins/testJobTemplate"
365
- templatePath = ' testJobTemplate'
366
- }
367
- }
354
+ if (! fileExists(templatePath)) {
355
+ sh " curl -Os https://raw.githubusercontent.com/adoptium/aqa-tests/master/buildenv/jenkins/testJobTemplate"
356
+ templatePath = ' testJobTemplate'
368
357
}
369
358
370
359
if (params. LIGHT_WEIGHT_CHECKOUT ) {
@@ -1222,34 +1211,42 @@ def triggerRerunJob () {
1222
1211
stage(' Rerun' ) {
1223
1212
def rerunJobName = " ${ JOB_NAME} _rerun"
1224
1213
def newJobs = [:]
1225
- generateJob(newJobs, rerunJobName, rerunJobName)
1226
- parallel newJobs
1227
-
1228
1214
def childParams = []
1229
- // loop through all the params and change the parameters if needed
1230
- params. each { param ->
1231
- // set PARALLEL, NUM_MACHINES and TEST_TIME to default values
1232
- // set TARGET to failed tests and set ITERATIONS to rerunIterations
1233
- if (param. key == " TARGET" ) {
1234
- childParams << string(name : param. key, value : " testList TESTLIST=" + env. FAILED_TESTS )
1235
- } else if (param. key == " PARALLEL" ) {
1236
- childParams << string(name : param. key, value : " None" )
1237
- } else if (param. key == " NUM_MACHINES" ) {
1238
- childParams << string(name : param. key, value : " " )
1239
- } else if (param. key == " TEST_TIME" ) {
1240
- childParams << string(name : param. key, value : " " )
1241
- } else if (param. key == " ITERATIONS" ) {
1242
- childParams << string(name : param. key, value : rerunIterations. toString())
1243
- } else {
1244
- def value = param. value. toString()
1245
- if (value == " true" || value == " false" ) {
1246
- childParams << booleanParam(name : param. key, value : value. toBoolean())
1215
+ echo " allocate a node for generating rerun job ..."
1216
+ node {
1217
+ generateJob(newJobs, rerunJobName, rerunJobName)
1218
+ parallel newJobs
1219
+
1220
+ // loop through all the params and change the parameters if needed
1221
+ params. each { param ->
1222
+ // set PARALLEL, NUM_MACHINES and TEST_TIME to default values
1223
+ // set TARGET to failed tests and set ITERATIONS to rerunIterations
1224
+ if (param. key == " TARGET" ) {
1225
+ childParams << string(name : param. key, value : " testList TESTLIST=" + env. FAILED_TESTS )
1226
+ } else if (param. key == " PARALLEL" ) {
1227
+ childParams << string(name : param. key, value : " None" )
1228
+ } else if (param. key == " NUM_MACHINES" ) {
1229
+ childParams << string(name : param. key, value : " " )
1230
+ } else if (param. key == " TEST_TIME" ) {
1231
+ childParams << string(name : param. key, value : " " )
1232
+ } else if (param. key == " ITERATIONS" ) {
1233
+ childParams << string(name : param. key, value : rerunIterations. toString())
1247
1234
} else {
1248
- childParams << string(name : param. key, value : value)
1235
+ def value = param. value. toString()
1236
+ if (value == " true" || value == " false" ) {
1237
+ childParams << booleanParam(name : param. key, value : value. toBoolean())
1238
+ } else {
1239
+ childParams << string(name : param. key, value : value)
1240
+ }
1249
1241
}
1250
1242
}
1251
1243
}
1252
- build job : rerunJobName, parameters : childParams, propagate : false
1244
+
1245
+ if (childParams) {
1246
+ echo " rerunJobName: ${ rerunJobName} "
1247
+ echo " childParams: ${ childParams} "
1248
+ build job : rerunJobName, parameters : childParams, propagate : false
1249
+ }
1253
1250
}
1254
1251
}
1255
1252
}
0 commit comments