diff options
author | Jose Lausuch <jose.lausuch@ericsson.com> | 2017-07-04 07:29:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-04 07:29:05 +0000 |
commit | 1da5990f3e25c375757349b30b4f47d288775682 (patch) | |
tree | 220bc03584cdaa36cd5de6eb4af464f0690cbc89 /reporting/run_test.sh | |
parent | 97f1a2cd7f27fdcb23b773ca4d7eabdc692235d1 (diff) | |
parent | c6750e539026339c428914795e35d94a60af27d6 (diff) |
Merge "Add jenkins jobs for automatic reporting dashboard deployment"
Diffstat (limited to 'reporting/run_test.sh')
-rwxr-xr-x | reporting/run_test.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/reporting/run_test.sh b/reporting/run_test.sh new file mode 100755 index 0000000..8c674ce --- /dev/null +++ b/reporting/run_test.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -o errexit +set -o pipefail + + +# Get script directory +SCRIPTDIR=`dirname $0` + +# Creating virtual environment +if [ ! -z $VIRTUAL_ENV ]; then + venv=$VIRTUAL_ENV +else + venv=$SCRIPTDIR/.venv + virtualenv $venv +fi + +source $venv/bin/activate + +export CONFIG_REPORTING_YAML=$SCRIPTDIR/reporting.yaml + +# *************** +# Run unit tests +# *************** +echo "Running unit tests..." + +# install python packages +easy_install -U setuptools +easy_install -U pip +pip install -r $SCRIPTDIR/docker/requirements.pip +pip install -e $SCRIPTDIR + +python $SCRIPTDIR/setup.py develop + +# unit tests +# TODO: remove cover-erase +# To be deleted when all functest packages will be listed +nosetests --with-xunit \ + --cover-package=$SCRIPTDIR/utils \ + --with-coverage \ + --cover-xml \ + $SCRIPTDIR/tests/unit +rc=$? + +deactivate |