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