From 899ed4ba8f51b0a4cae3be06830c015c2bb26062 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Tue, 11 Jun 2024 12:37:05 -0400 Subject: [PATCH] Using custom target for rerun builds Signed-off-by: Sophia Guo --- buildenv/jenkins/JenkinsfileBase | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index d49c077177..fc2c64e3ba 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -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") @@ -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") @@ -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") {