381826fb1fc6417e7301b43fd39adba092f2fbe3
[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 =
23   sphinx-build -W -b html api/ api/_build
24   doc8 docs/release/release-notes --ignore-path docs/release/release-notes/build
25   sphinx-build -W -b html docs/release/release-notes docs/release/release-notes/build/html
26
27 [testenv:pep8]
28 basepython = python2.7
29 commands = flake8
30
31 [testenv:pylint]
32 basepython = python2.7
33 whitelist_externals = bash
34 modules =
35   functest.api
36   functest.ci
37   functest.cli
38   functest.opnfv_tests.openstack.rally
39   functest.opnfv_tests.openstack.refstack
40   functest.opnfv_tests.openstack.snaps
41   functest.opnfv_tests.openstack.tempest
42   functest.opnfv_tests.openstack.vping
43   functest.opnfv_tests.sdn.odl
44   functest.opnfv_tests.vnf.router
45   functest.tests.unit.ci
46   functest.tests.unit.cli
47   functest.tests.unit.odl
48   functest.tests.unit.openstack.rally
49   functest.tests.unit.openstack.snaps
50   functest.tests.unit.openstack.tempest
51   functest.tests.unit.openstack.vping
52   functest.tests.unit.vnf.router
53   functest.tests.unit.utils
54   functest.utils.config
55   functest.utils.constants
56   functest.utils.env
57   functest.utils.functest_utils
58 commands =
59   bash -c "\
60     pylint -f parseable --ignore-imports=y --disable=locally-disabled functest | \
61     tee pylint.out | sed -ne '/Raw metrics/,//p'"
62   pylint --reports=n --errors-only functest
63   pylint --disable=locally-disabled \
64     --disable=duplicate-code \
65     --ignore-imports=y --reports=n {[testenv:pylint]modules}
66
67 [testenv:yamllint]
68 basepython = python2.7
69 files =
70   docker
71   functest/api
72   functest/ci
73   functest/opnfv_tests/vnf
74 commands =
75   yamllint -s {[testenv:yamllint]files}
76
77 [testenv:py35]
78 dirs =
79   functest/tests/unit/ci
80   functest/tests/unit/cli
81   functest/tests/unit/odl
82   functest/tests/unit/utils
83 commands = nosetests {[testenv:py35]dirs}
84
85 [testenv:cover]
86 basepython = python2.7
87 dirs =
88   functest/tests/unit/ci
89   functest/tests/unit/odl
90 commands = nosetests --with-coverage --cover-tests \
91   --cover-package functest.ci.check_deployment \
92   --cover-package functest.opnfv_tests.sdn.odl \
93   --cover-package functest.tests.unit \
94   --cover-min-percentage 100 {[testenv:cover]dirs}
95
96 [testenv:perm]
97 basepython = python2.7
98 whitelist_externals = bash
99 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
100 commands =
101   bash -c "\
102     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
103     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
104   bash -c "\
105     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"