Skip to content

Commit

Permalink
Using custom target for rerun builds
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Jun 12, 2024
1 parent bc92b7d commit 899ed4b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ def addFailedTestsGrinderLink(paths=""){
if (failedTestList) {
String failedTests = failedTestList.substring(0, failedTestList.length() - 1)
env.FAILED_TESTS= failedTests ?: ""
env.RERUN_TESTCASES=""
failedTestList = "testList+TESTLIST=" + failedTests
String url = env.RERUN_LINK
def failedTestUrl = url.replace(env.FAILED_TEST_TARGET, "TARGET=$failedTestList")
Expand All @@ -1288,6 +1289,16 @@ def addFailedTestsGrinderLink(paths=""){
if (jckDevtoolsFailedTestCaseList) {
customizedTestCases['jckdevtools'] = "${jckDevtoolsFailedTestCaseList}"
}

if (customizedTestCases.size() == 1) {
def testCases=customizedTestCases.values().first()
def customTarget=customizedTestCases.keySet().first()
def testCaseSize=testCases.count(' ')
if (testCaseSize < 80) {
env.RERUN_CUSTOMTARGET="${customTarget}_custom"
env.RERUN_TESTCASES="${testCases}"
}
}
customizedTestCases.each { target, testcases ->
def tempTestCases = testcases.substring(0, testcases.length() - 1)
tempTestCases = URLEncoder.encode(tempTestCases.toString(), "UTF-8")
Expand Down Expand Up @@ -1343,7 +1354,13 @@ def triggerRerunJob () {
// set PARALLEL, NUM_MACHINES and TEST_TIME to default values
// set TARGET to failed tests and set ITERATIONS to rerunIterations
if (param.key == "TARGET") {
childParams << string(name: param.key, value: "testList TESTLIST=" + env.FAILED_TESTS)
if (env.RERUN_TESTCASES) {
childParams << string(name: param.key, value: env.RERUN_CUSTOMTARGET)
} else {
childParams << string(name: param.key, value: "testList TESTLIST=" + env.FAILED_TESTS)
}
} else if (param.key == "CUSTOM_TARGET") {
childParams << string(name: param.key, value: env.RERUN_TESTCASES)
} else if (param.key == "PARALLEL") {
childParams << string(name: param.key, value: "None")
} else if (param.key == "NUM_MACHINES") {
Expand Down

0 comments on commit 899ed4b

Please sign in to comment.