From 23fa2fcb5517fafafe6e5263088ceddbb51c3d55 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Thu, 17 Nov 2016 15:43:03 +0100 Subject: Add Exceptions and Constants in opnfv module JIRA: FUNCTEST-497 Change-Id: I4bc0d545058c4778b632911bb317789110de29d1 Signed-off-by: Morgan Richomme --- run_unit_tests.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 run_unit_tests.sh (limited to 'run_unit_tests.sh') diff --git a/run_unit_tests.sh b/run_unit_tests.sh new file mode 100755 index 0000000..df511ce --- /dev/null +++ b/run_unit_tests.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -o errexit +set -o pipefail + +# Either Workspace is set (CI) +if [ -z $WORKSPACE ] +then + WORKSPACE="." +fi + + +# *************** +# Run unit tests +# *************** +echo "Running unit tests..." + +# start vitual env +virtualenv $WORKSPACE/modules_venv +source $WORKSPACE/modules_venv/bin/activate + +# install python packages +easy_install -U setuptools +easy_install -U pip +pip install $WORKSPACE + + +# unit tests +nosetests --with-xunit \ + --cover-package=opnfv \ + --with-coverage \ + --cover-xml \ + --cover-html \ + tests/unit +rc=$? + +deactivate -- cgit 1.2.3-korg