Merge "Fix warnings in all snaps-related modules"
[functest-xtesting.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.snaps
38   functest.opnfv_tests.openstack.vping
39   functest.opnfv_tests.sdn.odl
40   functest.opnfv_tests.vnf.router
41   functest.tests.unit.ci
42   functest.tests.unit.cli
43   functest.tests.unit.core
44   functest.tests.unit.energy
45   functest.tests.unit.odl
46   functest.tests.unit.openstack.snaps
47   functest.tests.unit.openstack.vping
48   functest.tests.unit.vnf.router
49   functest.tests.unit.utils.test_decorators
50   functest.utils.config
51   functest.utils.decorators
52   functest.utils.constants
53   functest.utils.env
54   functest.utils.functest_utils
55 commands =
56   bash -c "\
57     pylint -f parseable --disable=locally-disabled functest | \
58     tee pylint.out | sed -ne '/Raw metrics/,//p'"
59   pylint --reports=n --errors-only functest
60   pylint --disable=locally-disabled --reports=n {[testenv:pylint]modules}
61
62 [testenv:yamllint]
63 basepython = python2.7
64 files =
65   docker
66   functest/api
67   functest/ci
68   functest/opnfv_tests/vnf
69 commands =
70   yamllint -s {[testenv:yamllint]files}
71
72 [testenv:py35]
73 dirs =
74   functest/tests/unit/ci
75   functest/tests/unit/cli
76   functest/tests/unit/core
77   functest/tests/unit/energy
78   functest/tests/unit/odl
79   functest/tests/unit/utils
80 commands = nosetests {[testenv:py35]dirs}
81
82 [testenv:cover]
83 basepython = python2.7
84 dirs =
85   functest/tests/unit/ci
86   functest/tests/unit/core
87   functest/tests/unit/energy
88   functest/tests/unit/odl
89   functest/tests/unit/utils/test_decorators.py
90 commands = nosetests --with-coverage --cover-tests \
91   --cover-package functest.ci.check_deployment \
92   --cover-package functest.ci.tier_builder \
93   --cover-package functest.ci.tier_handler \
94   --cover-package functest.core \
95   --cover-package functest.energy \
96   --cover-package functest.opnfv_tests.sdn.odl \
97   --cover-package functest.tests.unit \
98   --cover-package functest.utils.decorators \
99   --cover-min-percentage 100 {[testenv:cover]dirs}
100
101 [testenv:perm]
102 basepython = python2.7
103 whitelist_externals = bash
104 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
105 commands =
106   bash -c "\
107     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
108     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
109   bash -c "\
110     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"