summaryrefslogtreecommitdiffstats
path: root/modules/run_unit_tests.sh
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-11-17 15:43:03 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-11-21 17:31:34 +0100
commit58da374e1660c541bff60dd6c3ba6f89f6f6793d (patch)
treec4736ce7590b963185cb4f3cedda6fb8c7cae319 /modules/run_unit_tests.sh
parent387600a6d881bfdc046772b2a3cfbfb59fd2469c (diff)
Add Exceptions and Constants in opnfv module
JIRA: FUNCTEST-497 Change-Id: I4bc0d545058c4778b632911bb317789110de29d1 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'modules/run_unit_tests.sh')
-rwxr-xr-xmodules/run_unit_tests.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/run_unit_tests.sh b/modules/run_unit_tests.sh
new file mode 100755
index 000000000..df511ce0c
--- /dev/null
+++ b/modules/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