Merge "Export env vars via os.environ in test_openstack_utils.py"
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,py35,py27,perm,cover
3
4 [testenv]
5 usedevelop = True
6 deps =
7   -c{toxinidir}/upper-constraints.txt
8   -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike
9   -r{toxinidir}/requirements.txt
10   -r{toxinidir}/test-requirements.txt
11 install_command = pip install {opts} {packages}
12 commands = nosetests --with-xunit \
13   --with-coverage \
14   --cover-tests \
15   --cover-package=functest \
16   --cover-xml \
17   --cover-html \
18   functest/tests/unit
19
20 [testenv:docs]
21 basepython = python2.7
22 commands = sphinx-build -W -b html api/ api/_build
23
24 [testenv:pep8]
25 basepython = python2.7
26 commands = flake8
27
28 [testenv:pylint]
29 basepython = python2.7
30 whitelist_externals = bash
31 modules =
32   functest.api
33   functest.ci
34   functest.cli
35   functest.core
36   functest.energy
37   functest.opnfv_tests.openstack.rally
38   functest.opnfv_tests.openstack.refstack_client
39   functest.opnfv_tests.openstack.snaps
40   functest.opnfv_tests.openstack.tempest
41   functest.opnfv_tests.openstack.vping
42   functest.opnfv_tests.sdn.odl
43   functest.opnfv_tests.vnf.router
44   functest.tests.unit.ci
45   functest.tests.unit.cli
46   functest.tests.unit.core
47   functest.tests.unit.energy
48   functest.tests.unit.odl
49   functest.tests.unit.openstack.rally
50   functest.tests.unit.openstack.refstack_client
51   functest.tests.unit.openstack.snaps
52   functest.tests.unit.openstack.tempest
53   functest.tests.unit.openstack.vping
54   functest.tests.unit.vnf.router
55   functest.tests.unit.utils.test_decorators
56   functest.utils.config
57   functest.utils.decorators
58   functest.utils.constants
59   functest.utils.env
60   functest.utils.functest_utils
61 commands =
62   bash -c "\
63     pylint -f parseable --disable=locally-disabled functest | \
64     tee pylint.out | sed -ne '/Raw metrics/,//p'"
65   pylint --reports=n --errors-only functest
66   pylint --disable=locally-disabled --ignore-imports=y --reports=n {[testenv:pylint]modules}
67
68 [testenv:yamllint]
69 basepython = python2.7
70 files =
71   docker
72   functest/api
73   functest/ci
74   functest/opnfv_tests/vnf
75 commands =
76   yamllint -s {[testenv:yamllint]files}
77
78 [testenv:py35]
79 dirs =
80   functest/tests/unit/ci
81   functest/tests/unit/cli
82   functest/tests/unit/core
83   functest/tests/unit/energy
84   functest/tests/unit/odl
85   functest/tests/unit/utils
86 commands = nosetests {[testenv:py35]dirs}
87
88 [testenv:cover]
89 basepython = python2.7
90 dirs =
91   functest/tests/unit/ci
92   functest/tests/unit/core
93   functest/tests/unit/energy
94   functest/tests/unit/odl
95   functest/tests/unit/utils/test_decorators.py
96 commands = nosetests --with-coverage --cover-tests \
97   --cover-package functest.ci.check_deployment \
98   --cover-package functest.ci.tier_builder \
99   --cover-package functest.ci.tier_handler \
100   --cover-package functest.core \
101   --cover-package functest.energy \
102   --cover-package functest.opnfv_tests.sdn.odl \
103   --cover-package functest.tests.unit \
104   --cover-package functest.utils.decorators \
105   --cover-min-percentage 100 {[testenv:cover]dirs}
106
107 [testenv:perm]
108 basepython = python2.7
109 whitelist_externals = bash
110 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
111 commands =
112   bash -c "\
113     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
114     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
115   bash -c "\
116     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"