From b77c5c3a28e3972fdb9d9d64ed56d950ae505232 Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Fri, 30 Aug 2024 10:18:41 -0400 Subject: [PATCH] Support custom config json file (#5535) (#5537) related: https://github.com/adoptium/aqa-tests/issues/5510 Signed-off-by: Lan Xia --- buildenv/jenkins/aqaTestPipeline.groovy | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/buildenv/jenkins/aqaTestPipeline.groovy b/buildenv/jenkins/aqaTestPipeline.groovy index 19572242df..83af95d8f8 100644 --- a/buildenv/jenkins/aqaTestPipeline.groovy +++ b/buildenv/jenkins/aqaTestPipeline.groovy @@ -37,15 +37,21 @@ fail = false JDK_VERSIONS.each { JDK_VERSION -> if (params.PLATFORMS == "release") { def configJson = [] - node("worker || (ci.role.test&&hw.arch.x86&&sw.os.linux)") { - checkout scm - dir (env.WORKSPACE) { - def filePath = "./aqa-tests/buildenv/jenkins/config/${params.VARIANT}/" - filePath = filePath + "default.json" - if (fileExists(filePath + "jdk${JDK_VERSION}.json")) { - filePath = filePath + "jdk${JDK_VERSION}.json" + if (params.CONFIG_JSON) { + echo "Read JSON from CONFIG_JSON parameter..." + configJson = readJSON text: "${params.CONFIG_JSON}" + } else { + node("worker || (ci.role.test&&hw.arch.x86&&sw.os.linux)") { + checkout scm + dir (env.WORKSPACE) { + def filePath = "./aqa-tests/buildenv/jenkins/config/${params.VARIANT}/" + filePath = filePath + "default.json" + if (fileExists(filePath + "jdk${JDK_VERSION}.json")) { + filePath = filePath + "jdk${JDK_VERSION}.json" + } + echo "Read JSON from file ${filePath}..." + configJson = readJSON(file: filePath) } - configJson = readJSON(file: filePath) } } @@ -77,6 +83,7 @@ if (fail) { } def generateJobs(jobJdkVersion, jobTestFlag, jobPlatforms, jobTargets) { + echo "jobJdkVersion: ${jobJdkVersion}, jobTestFlag: ${jobTestFlag}, jobPlatforms: ${jobPlatforms}, jobTargets: ${jobTargets}" if (jobTestFlag == "NONE") { jobTestFlag = "" } @@ -190,7 +197,7 @@ def generateJobs(jobJdkVersion, jobTestFlag, jobPlatforms, jobTargets) { } echo "AUTO_AQA_GEN: ${AUTO_AQA_GEN}" // Grinder job has special settings and should be regenerated specifically, not via aqaTestPipeline - if (AUTO_AQA_GEN && !TEST_JOB_NAME.contains("Grinder")) { + if (AUTO_AQA_GEN.toBoolean() && !TEST_JOB_NAME.contains("Grinder")) { String[] targetTokens = TARGET.split("\\.") def level = targetTokens[0]; def group = targetTokens[1];