From d2a33b40c6cbdb5ce1aa872094d59fa80dbcd853 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 11 May 2015 19:39:04 +0200 Subject: [PATCH] JJB integration: Return code from pybot shall be ignored Jenkins starts scripts in "Execute sheel" as bash -xe so any non-zero return code breaks the script on the spot. Pybot commands can return non-zero return code just when a critical test case fails. But in that case, the rest of script is now skipped, including the useful karaf.log download. This change adds "|| true" hack to make return code zero. Also, single and cluster scripts have the formatting of the pybot line unified now. Change-Id: I4a9dcf937ca4caca43ee9dfdfeda67ca172be608 Signed-off-by: Vratko Polak --- .../include-raw-integration-deploy-controller-run-test.sh | 5 ++++- .../include-raw-integration-start-cluster-run-test.sh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh index 60e6d0221..64af1e084 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -102,7 +102,10 @@ cat testplan.txt SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' ) echo "Starting Robot test suites ${SUITES} ..." -pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v CONTROLLER:${CONTROLLER0} -v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} ${TESTOPTIONS} ${SUITES} +pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \ +-v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${CONTROLLER0} \ +-v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true +# the "|| true" is there to swallow a non-zero error code, as we do not want a failed critical test case to stop this script (run with -xe by Jenkins) from gathering karaf.log echo "Fetching Karaf log" scp ${CONTROLLER0}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log . diff --git a/jjb/integration/include-raw-integration-start-cluster-run-test.sh b/jjb/integration/include-raw-integration-start-cluster-run-test.sh index 257fb5c90..19054f133 100644 --- a/jjb/integration/include-raw-integration-start-cluster-run-test.sh +++ b/jjb/integration/include-raw-integration-start-cluster-run-test.sh @@ -112,7 +112,8 @@ echo "Starting Robot test suites ${SUITES} ..." pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \ -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${CONTROLLER0} -v CONTROLLER1:${CONTROLLER1} -v CONTROLLER2:${CONTROLLER2} \ --v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} +-v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true +# the "|| true" is there to swallow a non-zero error code, as we do not want a failed critical test case to stop this script (run with -xe by Jenkins) from gathering karaf.log # -- 2.36.6