Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using custom target for rerun builds #5382

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 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,21 @@ 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 {
if (env.FAILED_TESTS.contains("_custom")) {
childParams << string(name: param.key, value: env.FAILED_TESTS)
} else {
childParams << string(name: param.key, value: "testList TESTLIST=" + env.FAILED_TESTS)
}
}
} else if (param.key == "CUSTOM_TARGET") {
if (env.RERUN_TESTCASES) {
childParams << string(name: param.key, value: env.RERUN_TESTCASES)
} else {
childParams << string(name: param.key, value: param.value.toString())
}
} else if (param.key == "PARALLEL") {
childParams << string(name: param.key, value: "None")
} else if (param.key == "NUM_MACHINES") {
Expand Down