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