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

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

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from all 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
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
Loading