summaryrefslogtreecommitdiffstats
path: root/modules/run_unit_tests.sh
blob: df511ce0cb7b33d8f34c43083c3ca7d7c439c8b6 (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
#!/bin/bash
set -o errexit
set -o pipefail

# Either Workspace is set (CI)
if [ -z $WORKSPACE ]
then
    WORKSPACE="."
fi


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

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

# install python packages
easy_install -U setuptools
easy_install -U pip
pip install $WORKSPACE


# unit tests
nosetests --with-xunit \
         --cover-package=opnfv \
         --with-coverage \
         --cover-xml \
         --cover-html \
         tests/unit
rc=$?

deactivate