From 753ba2aea7d60b56c2e0cfb4922041587ff0cedb Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Fri, 30 Aug 2024 11:46:42 -0400 Subject: [PATCH] Auto set LIGHT_WEIGHT_CHECKOUT based on ADOPTOPENJDK_REPO Signed-off-by: Lan Xia --- buildenv/jenkins/aqaTestPipeline.groovy | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/buildenv/jenkins/aqaTestPipeline.groovy b/buildenv/jenkins/aqaTestPipeline.groovy index 83af95d8f8..792b67fd6e 100644 --- a/buildenv/jenkins/aqaTestPipeline.groovy +++ b/buildenv/jenkins/aqaTestPipeline.groovy @@ -1,5 +1,7 @@ #!groovy +import groovy.transform.Field + def JDK_VERSIONS = params.JDK_VERSIONS.trim().split("\\s*,\\s*") def PLATFORMS = params.PLATFORMS.trim().split("\\s*,\\s*") def TARGETS = params.TARGETS ?: "Grinder" @@ -16,11 +18,20 @@ if (params.NUM_MACHINES) { } def SDK_RESOURCE = params.SDK_RESOURCE ? params.SDK_RESOURCE : "releases" def TIME_LIMIT = params.TIME_LIMIT ? params.TIME_LIMIT : 10 -def AUTO_AQA_GEN = params.AUTO_AQA_GEN ? params.AUTO_AQA_GEN.toBoolean() : false + +AUTO_AQA_GEN = params.AUTO_AQA_GEN ? params.AUTO_AQA_GEN.toBoolean() : false def TRSS_URL = params.TRSS_URL ? params.TRSS_URL : "https://trss.adoptium.net/" def TEST_FLAG = (params.TEST_FLAG) ?: "" def LIGHT_WEIGHT_CHECKOUT = params.LIGHT_WEIGHT_CHECKOUT ?: false +// If personal repo and branch are set, test jobs need to be regenerated (with LIGHT_WEIGHT_CHECKOUT = false) +// to take personal repo and branch. +if (params.ADOPTOPENJDK_REPO && !params.ADOPTOPENJDK_REPO.contains("adoptium/aqa-tests")) { + LIGHT_WEIGHT_CHECKOUT = false + AUTO_AQA_GEN = true + echo "ADOPTOPENJDK_REPO is set to personal repo. Auto-set LIGHT_WEIGHT_CHECKOUT: ${LIGHT_WEIGHT_CHECKOUT} and AUTO_AQA_GEN: ${AUTO_AQA_GEN}" +} + // Use BUILD_USER_ID if set and jdk-JDK_VERSIONS def DEFAULT_SUFFIX = (env.BUILD_USER_ID) ? "${env.BUILD_USER_ID} - jdk-${params.JDK_VERSIONS}" : "jdk-${params.JDK_VERSIONS}" def PIPELINE_DISPLAY_NAME = (params.PIPELINE_DISPLAY_NAME) ? "#${currentBuild.number} - ${params.PIPELINE_DISPLAY_NAME}" : "#${currentBuild.number} - ${DEFAULT_SUFFIX}"