Merge "Clean up Tempest blacklist"
[functest.git] / run_unit_tests.sh
1 #!/bin/bash
2 set -o errexit
3 set -o pipefail
4
5 # Either Workspace is set (CI)
6 if [ -z $WORKSPACE ]
7 then
8     WORKSPACE=`pwd`
9 fi
10
11
12 # ***************
13 # Run unit tests
14 # ***************
15 echo "Running unit tests..."
16
17 # start vitual env
18 virtualenv $WORKSPACE/functest_venv
19 source $WORKSPACE/functest_venv/bin/activate
20
21 # install python packages
22 sudo apt-get install -y build-essential python-dev python-pip
23 pip install --upgrade pip
24 pip install -r $WORKSPACE/test-requirements.txt
25 pip install $WORKSPACE
26
27 #install releng
28 rm -rf releng-unittests
29 git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng releng-unittests
30 pip install releng-unittests/modules/
31 rm -fr releng-unittests
32
33 export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
34 # unit tests
35 # TODO: remove cover-erase
36 # To be deleted when all functest packages will be listed
37 nosetests --with-xunit \
38          --with-coverage \
39          --cover-erase \
40          --cover-tests \
41          --cover-package=functest.ci \
42          --cover-package=functest.cli \
43          --cover-package=functest.core.testcase \
44          --cover-package=functest.opnfv_tests.sdn.odl.odl \
45          --cover-package=functest.opnfv_tests.vnf.ims \
46          --cover-package=functest.utils \
47          --cover-package=functest.opnfv_tests.openstack \
48          --cover-xml \
49          --cover-html \
50          --log-config=$(pwd)/functest/tests/unit/test_logging.ini \
51          functest/tests/unit
52 rc=$?
53
54 deactivate
55
56 exit $rc