Fix armband functest job suite name
[releng.git] / modules / run_unit_tests.sh
1 #!/bin/bash
2 set -o errexit
3 set -o pipefail
4
5 # Either Workspace is set (CI)
6 if [ -z $WORKSPACE ]
7 then
8     WORKSPACE="."
9 fi
10
11
12 # ***************
13 # Run unit tests
14 # ***************
15 echo "Running unit tests..."
16
17 # start vitual env
18 virtualenv $WORKSPACE/modules_venv
19 source $WORKSPACE/modules_venv/bin/activate
20
21 # install python packages
22 easy_install -U setuptools
23 easy_install -U pip
24 pip install $WORKSPACE
25
26
27 # unit tests
28 nosetests --with-xunit \
29          --cover-package=opnfv \
30          --with-coverage \
31          --cover-xml \
32          --cover-html \
33          tests/unit
34 rc=$?
35
36 deactivate