From 784f82e7306d54ce1e1d41d1bf044ca074464fe8 Mon Sep 17 00:00:00 2001 From: Karthik Kamurthy Date: Tue, 7 Sep 2021 15:54:19 +0530 Subject: [PATCH] * AQUILONAQD-955: JENKINS-PIPELINE-MIGRATION Added no-interactive option and pushing test results to file. --- tests/jenkinstest.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/jenkinstest.sh b/tests/jenkinstest.sh index 48f2c7446..6a575f670 100755 --- a/tests/jenkinstest.sh +++ b/tests/jenkinstest.sh @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -echo $(which python) - set -o pipefail TESTDIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)" BASEDIR="$(dirname "$(dirname "$TESTDIR")")" @@ -34,7 +32,7 @@ done # Massage unittest.conf -sed -e "s!^basedir =.*\$!basedir = /var/tmp/$USER/run!" \ +sed -e "s!^basedir =.*\$!basedir = /var/tmp/$USER/run!" \ -e "s/^kncport =.*$/kncport = ${KNCPORT}/" \ -e "s/^openport =.*$/openport = ${OPENPORT}/" \ -e "s/^git_port =.*$/git_port = ${GITPORT}/" \ @@ -43,9 +41,8 @@ sed -e "s!^basedir =.*\$!basedir = /var/tmp/$USER/run!" \ # Make sure UNITTEST_FAILURE is returned if tests fail otherwise jenkins does not mark build as failed -$TESTDIR/runtests.py --config $BASEDIR/unittest.conf --coverage | tee $TESTDIR/aqdtests.log -# $TESTDIR/runtests.py --config $BASEDIR/unittest.conf --coverage 2>&1 --no-interactive | tee $TESTDIR/aqdtests.log -# if [ $(grep -c '^OK$' $TESTDIR/aqdtests.log 2>/dev/null) -ne 2 ]; then -# echo UNITTEST_FAILURE -# exit 1 -# fi +$TESTDIR/runtests.py --config $BASEDIR/unittest.conf --coverage 2>&1 --no-interactive | tee $TESTDIR/aqdtests.log +if [ $(grep -c '^OK$' $TESTDIR/aqdtests.log 2>/dev/null) -ne 2 ]; then + echo UNITTEST_FAILURE + exit 1 +fi