summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/run_unit_tests.sh
blob: 6b0e3b2b190e47bf49fe3051cb5c206f2ce8bd97 (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
#!/bin/bash
set -o errexit
set -o pipefail

# ******************************
# prepare the env for the tests
# ******************************
# Either Workspace is set (CI)
if [ -z $WORKSPACE ]
then
    WORKSPACE="."
fi

export CONFIG_REPORTING_YAML=./reporting.yaml

# ***************
# Run unit tests
# ***************
echo "Running unit tests..."

# start vitual env
virtualenv $WORKSPACE/reporting_venv
source $WORKSPACE/reporting_venv/bin/activate

# install python packages
easy_install -U setuptools
easy_install -U pip
pip install -r $WORKSPACE/docker/requirements.pip
pip install -e $WORKSPACE

python $WORKSPACE/setup.py develop

# unit tests
# TODO: remove cover-erase
# To be deleted when all functest packages will be listed
nosetests --with-xunit \
         --cover-package=utils \
         --with-coverage \
         --cover-xml \
         tests/unit
rc=$?

deactivate