blob: 4c43bfc9688684fbe10a70f53d5392adcff362c7 (
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
45
46
47
48
49
50
51
52
53
54
55
56
|
#!/bin/bash
set -o errexit
set -o pipefail
# Either Workspace is set (CI)
if [ -z $WORKSPACE ]
then
WORKSPACE=`pwd`
fi
# ***************
# Run unit tests
# ***************
echo "Running unit tests..."
# start vitual env
virtualenv $WORKSPACE/functest_venv
source $WORKSPACE/functest_venv/bin/activate
# install python packages
sudo apt-get install -y build-essential python-dev python-pip
pip install --upgrade pip
pip install -r $WORKSPACE/test-requirements.txt
pip install $WORKSPACE
#install releng
rm -rf releng-unittests
git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng releng-unittests
pip install releng-unittests/modules/
rm -fr releng-unittests
export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
# unit tests
# TODO: remove cover-erase
# To be deleted when all functest packages will be listed
nosetests --with-xunit \
--with-coverage \
--cover-erase \
--cover-tests \
--cover-package=functest.ci \
--cover-package=functest.cli \
--cover-package=functest.core.testcase_base \
--cover-package=functest.opnfv_tests.sdn.odl.odl \
--cover-package=functest.opnfv_tests.vnf.ims \
--cover-package=functest.utils \
--cover-package=functest.opnfv_tests.openstack.rally \
--cover-xml \
--cover-html \
--log-config=$(pwd)/functest/tests/unit/test_logging.ini \
functest/tests/unit
rc=$?
deactivate
exit $rc
|