add zte-virtul3 and zte-virtul4 to Doctor CI pods
[releng.git] / utils / test / reporting / run_unit_tests.sh
1 #!/bin/bash
2 set -o errexit
3 set -o pipefail
4
5 # ******************************
6 # prepare the env for the tests
7 # ******************************
8 # Either Workspace is set (CI)
9 if [ -z $WORKSPACE ]
10 then
11     WORKSPACE="."
12 fi
13
14 export CONFIG_REPORTING_YAML=./reporting.yaml
15
16 # ***************
17 # Run unit tests
18 # ***************
19 echo "Running unit tests..."
20
21 # start vitual env
22 virtualenv $WORKSPACE/reporting_venv
23 source $WORKSPACE/reporting_venv/bin/activate
24
25 # install python packages
26 easy_install -U setuptools
27 easy_install -U pip
28 pip install -r $WORKSPACE/docker/requirements.pip
29 pip install -e $WORKSPACE
30
31 python $WORKSPACE/setup.py develop
32
33 # unit tests
34 # TODO: remove cover-erase
35 # To be deleted when all functest packages will be listed
36 nosetests --with-xunit \
37          --cover-package=utils \
38          --with-coverage \
39          --cover-xml \
40          tests/unit
41 rc=$?
42
43 deactivate