From d282f09d23b4cd36b4c3d7be2ef8e71d2dd8d2b2 Mon Sep 17 00:00:00 2001 From: Anna Babu Palathingal <148897727+annaibm@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:47:05 -0400 Subject: [PATCH] Avoid unnecessary copying of system lib files - Ensure system lib files are only copied when isSVTTestRepo is set to true - Prevent unnecessary copying of system lib files to systemtest_prereqs directory related:https://github.ibm.com/runtimes/backlog/issues/1457 Signed-off-by: Anna Babu Palathingal --- buildenv/jenkins/JenkinsfileBase | 13 ++++++++++++- get.sh | 6 +----- system/common.xml | 16 +++++++++------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index db1c176bc6..834a93e4bc 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -112,7 +112,7 @@ def setupEnv() { env.LIGHT_WEIGHT_CHECKOUT = (params.LIGHT_WEIGHT_CHECKOUT == false) ? params.LIGHT_WEIGHT_CHECKOUT : true env.GENERATE_JOBS = params.GENERATE_JOBS ?: false - env.isSVTTestRepo=false + env.IS_SVT_TESTREPO = "" if (JOB_NAME.contains("Grinder")) { def currentDate = new Date() @@ -512,6 +512,17 @@ def setup() { VENDOR_TEST_DIRS = (params.VENDOR_TEST_DIRS) ? "--vendor_dirs \"${params.VENDOR_TEST_DIRS}\"" : "" VENDOR_TEST_SHAS = (params.VENDOR_TEST_SHAS) ? "--vendor_shas \"${params.VENDOR_TEST_SHAS}\"" : "" + def vendorRepos = params.VENDOR_TEST_REPOS.split(',') + // Check if any vendor repo contains SVTTestRepo + for (int i = 0; i < vendorRepos.size(); i++) { + def repoURL = vendorRepos[i] + echo "Vendor repo is ${repoURL}" + if (repoURL.contains('SVTTestRepo')) { + env.IS_SVT_TESTREPO = 'true' + echo "IS_SVT_TESTREPO is set to ${env.IS_SVT_TESTREPO}" + } + } + // handle three cases (true/false/null) in params.TEST_IMAGES_REQUIRED and params.DEBUG_IMAGES_REQUIRED // Only set image required to false if params is set to false. In get.sh, the default value is true TEST_IMAGES_REQUIRED = (params.TEST_IMAGES_REQUIRED == false) ? "--test_images_required false" : "" diff --git a/get.sh b/get.sh index 513582691a..3465927726 100755 --- a/get.sh +++ b/get.sh @@ -637,11 +637,7 @@ getVendorTestMaterial() { continue fi fi - - if [[ "$repoURL" =~ "SVTTestRepo" ]]; then - isSVTTestRepo=true - fi - + echo "git clone ${branchOption} $repoURL $dest" git clone -q --depth 1 $branchOption $repoURL $dest diff --git a/system/common.xml b/system/common.xml index 6b4bc71175..96318a38d9 100644 --- a/system/common.xml +++ b/system/common.xml @@ -350,14 +350,16 @@ - - - - - - - + + + + + + + + +