JJB integration: Return code from pybot shall be ignored 45/20045/1
authorVratko Polak <vrpolak@cisco.com>
Mon, 11 May 2015 17:39:04 +0000 (19:39 +0200)
committerVratko Polak <vrpolak@cisco.com>
Mon, 11 May 2015 17:39:04 +0000 (19:39 +0200)
Jenkins starts scripts in "Execute sheel" as bash -xe <path>
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 <vrpolak@cisco.com>
jjb/integration/include-raw-integration-deploy-controller-run-test.sh
jjb/integration/include-raw-integration-start-cluster-run-test.sh

index 60e6d02219d770bea584a1c4740e32e40e7431f9..64af1e084031d0a3b7b5cc2cf6283efb42308315 100644 (file)
@@ -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 .
index 257fb5c90645d8d240f847c4341cca8d459be7a7..19054f13334b4345a32190145bc092c23fcff22a 100644 (file)
@@ -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
 
 
 #