Skip to content

Commit a5505fd

Browse files
committed
allocate node for generate rerun job
Signed-off-by: Lan Xia <[email protected]>
1 parent c76f2fa commit a5505fd

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

buildenv/jenkins/JenkinsfileBase

+34-37
Original file line numberDiff line numberDiff line change
@@ -351,20 +351,9 @@ def createJob( TEST_JOB_NAME, ARCH_OS ) {
351351
}
352352

353353
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'
368357
}
369358

370359
if (params.LIGHT_WEIGHT_CHECKOUT) {
@@ -1222,34 +1211,42 @@ def triggerRerunJob () {
12221211
stage('Rerun') {
12231212
def rerunJobName = "${JOB_NAME}_rerun"
12241213
def newJobs = [:]
1225-
generateJob(newJobs, rerunJobName, rerunJobName)
1226-
parallel newJobs
1227-
12281214
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())
12471234
} 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+
}
12491241
}
12501242
}
12511243
}
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+
}
12531250
}
12541251
}
12551252
}

functional/MBCS_Tests/urlclassloader/playlist.xml

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
-->
1515
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../TestConfig/playlist.xsd">
16+
<test>
17+
<testCaseName>myTest</testCaseName>
18+
<command>$(JAVA_COMMAND) -versadfasfs; \
19+
$(TEST_STATUS)</command>
20+
<platformRequirements>os.linux</platformRequirements>
21+
<levels>
22+
<level>special</level>
23+
</levels>
24+
<groups>
25+
<group>functional</group>
26+
</groups>
27+
</test>
1628
<test>
1729
<testCaseName>MBCS_Tests_urlclassloader_ja_JP_linux</testCaseName>
1830
<command>LANG=ja_JP.UTF-8 bash $(TEST_RESROOT)$(D)test.sh; \

0 commit comments

Comments
 (0)