Skip to content

Commit

Permalink
Avoid unnecessary copying of system lib files
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
annaibm committed Jul 5, 2024
1 parent dd87740 commit d282f09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
13 changes: 12 additions & 1 deletion buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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" : ""
Expand Down
6 changes: 1 addition & 5 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 9 additions & 7 deletions system/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,16 @@
</copy>
</then>
</if>
<condition property="isSVTTestRepo" value="true">
<isset property="env.isSVTTestRepo"/>
</condition>
<condition property="isSVTTestRepo" value="false">
<not>
<isset property="env.isSVTTestRepo"/>
</not>
<property name="IS_SVT_TESTREPO" value="${env.IS_SVT_TESTREPO}"/>
<condition property="isSVTTestRepo" value="true" else="false">
<and>
<isset property="IS_SVT_TESTREPO"/>
<equals arg1="${IS_SVT_TESTREPO}" arg2="true"/>
</and>
</condition>

<echo message="isSVTTestRepo is ${isSVTTestRepo}"/>

<if>
<equals arg1="${isSVTTestRepo}" arg2="true"/>
<then>
Expand Down

0 comments on commit d282f09

Please sign in to comment.