diff options
author | 2016-11-22 11:05:21 +0000 | |
---|---|---|
committer | 2016-11-22 11:05:21 +0000 | |
commit | e1001a2789cfb7af9f8ae269e04a6d0750c7d1f3 (patch) | |
tree | d0501b7de8729044f1c273e64f83c1bc1192820a /modules/run_unit_tests.sh | |
parent | e3d9ba34e99dab52e3e33a6c878b00a9f380c760 (diff) | |
parent | 58da374e1660c541bff60dd6c3ba6f89f6f6793d (diff) |
Merge "Add Exceptions and Constants in opnfv module"
Diffstat (limited to 'modules/run_unit_tests.sh')
-rwxr-xr-x | modules/run_unit_tests.sh | 36 |
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 |