summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/run_test.sh
blob: 8c674ce5fc9eab12247b873141776d1d79d1a2d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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