Switch to Docker post_checkout hooks
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,py35,py27,perm
3
4 [testenv]
5 usedevelop = True
6 deps =
7   -r{toxinidir}/requirements.txt
8   -r{toxinidir}/test-requirements.txt
9 install_command = pip install \
10   -c{toxinidir}/upper-constraints.txt \
11   -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata \
12   {opts} {packages}
13 commands = nosetests --with-xunit \
14   --with-coverage \
15   --cover-tests \
16   --cover-package=functest \
17   --cover-xml \
18   --cover-html \
19   functest/tests/unit
20
21 [testenv:docs]
22 basepython = python2.7
23 commands = sphinx-build -W -b html api/ api/_build
24
25 [testenv:pep8]
26 basepython = python2.7
27 commands = flake8
28
29 [testenv:pylint]
30 basepython = python2.7
31 whitelist_externals = bash
32 modules =
33   functest.core
34   functest.opnfv_tests.sdn.odl
35   functest.tests.unit.core
36   functest.tests.unit.odl
37   functest.tests.unit.utils.test_decorators
38   functest.utils.decorators
39 commands =
40   bash -c "\
41     pylint -f parseable --disable=locally-disabled functest | \
42     tee pylint.out | sed -ne '/Raw metrics/,//p'"
43   pylint --disable=locally-disabled --reports=n {[testenv:pylint]modules}
44
45 [testenv:py35]
46 dirs =
47   functest/tests/unit/core
48   functest/tests/unit/odl
49   functest/tests/unit/utils/test_decorators.py
50 commands = nosetests {[testenv:py35]dirs}
51
52 [testenv:perm]
53 basepython = python2.7
54 whitelist_externals = bash
55 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
56 commands =
57   bash -c "\
58     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
59     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
60   bash -c "\
61     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"