summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/run_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/reporting/run_test.sh')
-rwxr-xr-xutils/test/reporting/run_test.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/utils/test/reporting/run_test.sh b/utils/test/reporting/run_test.sh
new file mode 100755
index 000000000..8c674ce5f
--- /dev/null
+++ b/utils/test/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