8c674ce5fc9eab12247b873141776d1d79d1a2d5
[releng.git] / utils / test / reporting / run_test.sh
1 #!/bin/bash
2 set -o errexit
3 set -o pipefail
4
5
6 # Get script directory
7 SCRIPTDIR=`dirname $0`
8
9 # Creating virtual environment
10 if [ ! -z $VIRTUAL_ENV ]; then
11     venv=$VIRTUAL_ENV
12 else
13     venv=$SCRIPTDIR/.venv
14     virtualenv $venv
15 fi
16
17 source $venv/bin/activate
18
19 export CONFIG_REPORTING_YAML=$SCRIPTDIR/reporting.yaml
20
21 # ***************
22 # Run unit tests
23 # ***************
24 echo "Running unit tests..."
25
26 # install python packages
27 easy_install -U setuptools
28 easy_install -U pip
29 pip install -r $SCRIPTDIR/docker/requirements.pip
30 pip install -e $SCRIPTDIR
31
32 python $SCRIPTDIR/setup.py develop
33
34 # unit tests
35 # TODO: remove cover-erase
36 # To be deleted when all functest packages will be listed
37 nosetests --with-xunit \
38          --cover-package=$SCRIPTDIR/utils \
39          --with-coverage \
40          --cover-xml \
41          $SCRIPTDIR/tests/unit
42 rc=$?
43
44 deactivate