Skip to content

Commit

Permalink
Adjust Grinder link to properly rerun with 0 iterations and always re…
Browse files Browse the repository at this point in the history
…run with parallel=none (#5829)

* Adjust Grinder link to properly rerun with 0 iterations and always rerun with parallel=none

* Fix Parallel value to 'None' and revert change of order for declaring env variables
  • Loading branch information
jiekang authored Dec 18, 2024
1 parent b0d8d40 commit a13373a
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -1189,44 +1189,45 @@ 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"
}

url += "${key}=${value}"
if (i != urlParams.size()) {
url += "&"
}
i++;
}

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")
}

// reset LIGHT_WEIGHT_CHECKOUT to false in Rerun in Grinder link
url = url.replace("LIGHT_WEIGHT_CHECKOUT=true", "LIGHT_WEIGHT_CHECKOUT=false")

currentBuild.description += "<br><a href=\"https://github.com/adoptium/aqa-tests/wiki/How-to-Run-a-Grinder-Build-on-Jenkins\">Grinder Wiki</a>"
echo "Rerun in Grinder: ${url}"
currentBuild.description += "<br><a href=${url}>Rerun in Grinder</a> Change TARGET to run only the failed test targets."
Expand Down

0 comments on commit a13373a

Please sign in to comment.