Skip to content

Commit

Permalink
Added system_lib for system prestage jars
Browse files Browse the repository at this point in the history
- Prestage system test prequisities to system_lib

Signed-off-by: Anna Babu Palathingal <anna.bp@ibm.com>
  • Loading branch information
annaibm committed May 9, 2024
1 parent 83bec27 commit ee2d527
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 24 deletions.
48 changes: 31 additions & 17 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setupEnv() {
env.JOBSTARTTIME = sh(script: 'LC_TIME=C date +"%a, %d %b %Y %T %z"', returnStdout: true).trim()

// Terminate any previous test related processes that are running
terminateTestProcesses()
terminateTestProcesses()

if ( params.JDK_VERSION ) {
env.ORIGIN_JDK_VERSION = params.JDK_VERSION
Expand Down Expand Up @@ -106,7 +106,8 @@ def setupEnv() {
env.EXIT_SUCCESS = params.EXIT_SUCCESS ? params.EXIT_SUCCESS : false
NUM_MACHINES = params.NUM_MACHINES ? params.NUM_MACHINES.toInteger() : 1
env.LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../testDependency/lib" : "${WORKSPACE}/../../testDependency/lib"
env.OPENJCEPLUS_GIT_REPO = params.OPENJCEPLUS_GIT_REPO ?: "https://github.com/ibmruntimes/OpenJCEPlus.git"
env.SYSTEM_LIB_DIR = JOB_NAME.contains("SmokeTests") ? "${WORKSPACE}/../../../../../testDependency/system_lib" : "${WORKSPACE}/../../testDependency/system_lib"
env.OPENJCEPLUS_GIT_REPO = params.OPENJCEPLUS_GIT_REPO ?: "https://github.com/ibmruntimes/OpenJCEPlus.git"
env.OPENJCEPLUS_GIT_BRANCH = params.OPENJCEPLUS_GIT_BRANCH ?: "semeru-java${params.JDK_VERSION}"

env.LIGHT_WEIGHT_CHECKOUT = (params.LIGHT_WEIGHT_CHECKOUT == false) ? params.LIGHT_WEIGHT_CHECKOUT : true
Expand Down Expand Up @@ -208,12 +209,18 @@ def setupParallelEnv() {
// check for each lib. If lib does not exist, donwload it.
// If lib exists, SHA will be checked. Re-download if SHA does not match.
timeout(time: 20, unit: 'MINUTES') {
def customUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def defaultUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def systemUrl = "https://ci.adoptium.net/job/systemtest.getDependency/lastSuccessfulBuild/artifact/"
env.LIB_DIR = (env.BUILD_LIST == 'system') ? env.SYSTEM_LIB_DIR : env.LIB_DIR
def customUrl = (env.BUILD_LIST == 'system') ? systemUrl : defaultUrl
if (PLATFORM.contains("windows")) {
env.LIB_DIR = env.LIB_DIR.replaceAll("\\\\", "/")
}
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default -customUrl ${customUrl}"
}
env.LIB_DIR = env.LIB_DIR.replaceAll("\\\\", "/")
}
if (env.BUILD_LIST != 'system') {
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default -customUrl ${customUrl}"
} else {
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default"
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
echo "Cannot pre-stage test libs from ${env.LIB_DIR} on the machine. Skipping..."
Expand Down Expand Up @@ -316,7 +323,7 @@ def setupParallelEnv() {

}

// Returns NUM_LIST from parallelList.mk.
// Returns NUM_LIST from parallelList.mk.
// NUM_LIST can be different than numOfMachines.
def genParallelList(PARALLEL_OPTIONS) {
String unsetLLP = ""
Expand Down Expand Up @@ -416,7 +423,7 @@ def setup() {
if (params.SDK_RESOURCE == 'nightly') {
// remove single quote to allow variables to be set in CUSTOMIZED_SDK_URL
CUSTOMIZED_SDK_URL_OPTION = "-c ${params.CUSTOMIZED_SDK_URL}"
} else if (!params.SDK_RESOURCE || params.SDK_RESOURCE == 'customized') {
} else if (!params.SDK_RESOURCE || params.SDK_RESOURCE == 'customized') {
SDK_RESOURCE = "customized"
CUSTOMIZED_SDK_URL_OPTION = "-c '${params.CUSTOMIZED_SDK_URL}'"
if (params.ADDITIONAL_ARTIFACTS_REQUIRED == "RI_JDK") {
Expand All @@ -438,7 +445,7 @@ def setup() {
error("SDK_RESOURCE: ${params.SDK_RESOURCE} and CUSTOMIZED_SDK_URL: ${params.CUSTOMIZED_SDK_URL} combo is not supported!")
}
} else {
if (params.SDK_RESOURCE == 'customized') {
if (params.SDK_RESOURCE == 'customized') {
error("SDK_RESOURCE: ${params.SDK_RESOURCE}, please provide CUSTOMIZED_SDK_URL")
} else {
CUSTOMIZED_SDK_URL_OPTION = ""
Expand Down Expand Up @@ -467,7 +474,7 @@ def setup() {
if (CLONE_OPENJ9_OPTION == "") {
if (env.BUILD_LIST.contains('functional')) {
CLONE_OPENJ9_OPTION = "--clone_openj9 true"
// If USE_TESTENV_PROPERTIES = false, set Openj9 repo and brnach.
// If USE_TESTENV_PROPERTIES = false, set Openj9 repo and brnach.
// Otherwise, testenv.properties will be used.
// And the Openj9 repo and brnach values will be set in get.sh
if(!params.USE_TESTENV_PROPERTIES) {
Expand Down Expand Up @@ -656,11 +663,18 @@ def buildTest() {
// check for each lib. If lib does not exist, donwload it.
// If lib exists, SHA will be checked. Re-download if SHA does not match.
timeout(time: 20, unit: 'MINUTES') {
def customUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def defaultUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def systemUrl = "https://ci.adoptium.net/job/systemtest.getDependency/lastSuccessfulBuild/artifact/"
env.LIB_DIR = (env.BUILD_LIST == 'system') ? env.SYSTEM_LIB_DIR : env.LIB_DIR
def customUrl = (env.BUILD_LIST == 'system') ? systemUrl : defaultUrl
if (PLATFORM.contains("windows")) {
env.LIB_DIR = env.LIB_DIR.replaceAll("\\\\", "/")
}
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default -customUrl ${customUrl}"
if (env.BUILD_LIST != 'system') {
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default -customUrl ${customUrl}"
} else {
sh "perl ./aqa-tests/TKG/scripts/getDependencies.pl -path ${env.LIB_DIR} -task default"
}
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
Expand Down Expand Up @@ -1014,10 +1028,10 @@ def testExecution() {
def terminateTestProcesses() {
echo "PROCESSCATCH: Terminating any hung/left over test processes:"

def statusCode=sh(script:"aqa-tests/terminateTestProcesses.sh ${env.USER} 2>&1", returnStatus:true)
if (statusCode != 0) {
echo "rc = ${statusCode}, Unable to terminate all processes."
}
def statusCode=sh(script:"aqa-tests/terminateTestProcesses.sh ${env.USER} 2>&1", returnStatus:true)
if (statusCode != 0) {
echo "rc = ${statusCode}, Unable to terminate all processes."
}
}

def getJDKImpl(jvm_version) {
Expand Down
8 changes: 7 additions & 1 deletion system/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@
</target>

<target name="common_dist" description="generate the distribution">
<condition property="system_lib_dir" value="${env.SYSTEM_LIB_DIR}" else="${TEST_ROOT}/systemtest_prereqs/">
<isset property="env.SYSTEM_LIB_DIR"/>
</condition>
<echo message="SYSTEMTEST_DEST is set to: ${SYSTEMTEST_DEST}" />
<echo message="TEST_ROOT is set to: ${TEST_ROOT}" />
<echo message="SYSTEM_LIB_DIR is set to: ${env.SYSTEM_LIB_DIR}" />
<copy todir="${SYSTEMTEST_DEST}/STF">
<fileset dir="${SYSTEMTEST_ROOT}/STF" includes="**" />
</copy>
Expand All @@ -337,7 +343,7 @@
</then>
</if>
<copy todir="${SYSTEMTEST_DEST}/systemtest_prereqs/">
<fileset dir="${TEST_ROOT}/systemtest_prereqs/" includes="**" />
<fileset dir="${system_lib_dir}" includes="**"/>
</copy>
</target>

Expand Down
18 changes: 12 additions & 6 deletions system/system.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ifndef CYGWIN
OSTYPE?=$(shell echo $$OSTYPE)
CYGWIN:=0
ifeq ($(OSTYPE),cygwin)
CYGWIN:=1
CYGWIN:=1
endif
ifeq ($(TERM),cygwin)
CYGWIN:=1
CYGWIN:=1
endif
endif
$(warning CYGWIN is $(CYGWIN))
Expand All @@ -31,9 +31,9 @@ ifeq ($(CYGWIN),1)
$(warning Running under cygwin, looking for Windows perl on path)
PERL:=$(shell which -a perl.exe | grep /perl/bin | sort | uniq)
ifeq (,$(PERL))
$(error Unable to find Windows perl e.g. Strawberry perl in a /perl/bin subdirectory on PATH. Install perl or add to PATH and retry)
$(error Unable to find Windows perl e.g. Strawberry perl in a /perl/bin subdirectory on PATH. Install perl or add to PATH and retry)
else
$(warning Found perl in $(PERL))
$(warning Found perl in $(PERL))
endif
PERL:=$(dir $(PERL))
export PATH:=$(PERL):$(PATH)
Expand Down Expand Up @@ -71,15 +71,21 @@ ifdef JVM_OPTIONS
APPLICATION_OPTIONS := $(APPLICATION_OPTIONS) -jvmArgs $(Q)$(JVM_OPTIONS)$(Q)
endif

ifndef SYSTEM_LIB_DIR
SYSTEM_LIB_DIR := "/home/jenkins/workspace/Grinder/aqa-tests/systemtest_prereqs"
endif

$(info SYSTEM_LIB_DIR is $(SYSTEM_LIB_DIR))

define SYSTEMTEST_CMD_TEMPLATE
perl $(SYSTEMTEST_RESROOT)$(D)STF$(D)stf.core$(D)scripts$(D)stf.pl \
-test-root=$(Q)$(SYSTEMTEST_RESROOT)$(D)STF;$(SYSTEMTEST_RESROOT)$(D)aqa-systemtest$(OPENJ9_PRAM)$(Q) \
-systemtest-prereqs=$(Q)$(SYSTEMTEST_RESROOT)$(D)systemtest_prereqs$(Q) \
-systemtest-prereqs=$(Q)$(SYSTEM_LIB_DIR)$(D)$(Q) \
-java-args=$(SQ)$(JAVA_ARGS)$(SQ) \
-results-root=$(REPORTDIR)
endef

# Default test to be run for system_custom in regular system test builds
# Default test to be run for system_custom in regular system test builds
CUSTOM_TARGET ?= -test=ClassloadingLoadTest

ifneq ($(JDK_VERSION),8)
Expand Down

0 comments on commit ee2d527

Please sign in to comment.