From bedc3ac421a7972b6264742bec375c25fa4c35f5 Mon Sep 17 00:00:00 2001 From: Jie Kang Date: Mon, 16 Dec 2024 16:48:52 -0500 Subject: [PATCH] Adjust Grinder link to properly rerun with 0 iterations and always rerun with parallel=none --- buildenv/jenkins/JenkinsfileBase | 45 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index 2d8bdc81e8..86459f39f2 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -1189,50 +1189,51 @@ def addGrinderLink() { def labelValue = "" def targetValue = "" def customTargetKeyValue = "" - def rerunIterations = "" def urlParams = params.findAll { // Exclude separator and help text parameters from url !(it.key.endsWith('_PARAMS') || it.key.endsWith('_HELP_TEXT')) } urlParams.each { key, value -> value = URLEncoder.encode(value.toString(), "UTF-8") - url += "${key}=${value}" - if (i != urlParams.size()) { - url += "&" - } - i++; - if ( key == "LABEL" ) { + if (key == "LABEL") { labelValue = "LABEL=${value}" } - if ( key == "TARGET" ) { + if (key == "TARGET") { targetValue = "TARGET=${value}" } - if ( key == "CUSTOM_TARGET") { + if (key == "CUSTOM_TARGET") { customTargetKeyValue = "CUSTOM_TARGET=${value}" } - if ( key == "RERUN_ITERATIONS") { - rerunIterations = "RERUN_ITERATIONS=${value}" + // Always set RERUN_ITERATIONS to 0 for Grinder link + if (key == "RERUN_ITERATIONS") { + value = "0" + } + // Always set LightWeightCheckout to false for Grinder link + if (key == "LIGHT_WEIGHT_CHECKOUT") { + value = "false" + } + // Always set Parallel to None for Grinder link + if (key == "PARALLEL") { + value = "NONE" } - } - env.RERUN_LINK = url - env.FAILED_TEST_TARGET = targetValue - env.CUSTOM_TARGET_KEY_VALUE = customTargetKeyValue - - // reset RERUN_ITERATIONS to 0 in Rerun in Grinder link - if (rerunIterations) { - url = url.replace(rerunIterations,"RERUN_ITERATIONS=0") + url += "${key}=${value}" + if (i != urlParams.size()) { + url += "&" + } + i++; } - // reset LIGHT_WEIGHT_CHECKOUT to false in Rerun in Grinder link - url = url.replace("LIGHT_WEIGHT_CHECKOUT=true", "LIGHT_WEIGHT_CHECKOUT=false") - currentBuild.description += "
Grinder Wiki" echo "Rerun in Grinder: ${url}" currentBuild.description += "
Rerun in Grinder Change TARGET to run only the failed test targets." def sameMachineUrl = url.replace(labelValue,"LABEL=${NODE_NAME}") echo "Rerun in Grinder on same machine: ${sameMachineUrl}" currentBuild.description += "
Rerun in Grinder on same machine Change TARGET to run only the failed test targets. For dynamic vm agents as they are created at runtime and quickly recycled, it may not be possible to rerun on the same agent." + + env.RERUN_LINK = url + env.FAILED_TEST_TARGET = targetValue + env.CUSTOM_TARGET_KEY_VALUE = customTargetKeyValue } def addFailedTestsGrinderLink(paths=""){