Merge "Fix the yamllint errors in functest/ci"
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,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.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:yamllint]
46 basepython = python2.7
47 files =
48   docker/components/testcases.yaml
49   docker/healthcheck/testcases.yaml
50   docker/smoke/testcases.yaml
51   docker/parser/testcases.yaml
52   docker/features/testcases.yaml
53   docker/vnf/testcases.yaml
54   functest/ci/config_aarch64_patch.yaml
55   functest/ci/config_functest.yaml
56   functest/ci/config_patch.yaml
57   functest/ci/testcases.yaml
58 commands =
59   yamllint {[testenv:yamllint]files}
60   - yamllint functest
61
62 [testenv:py35]
63 dirs =
64   functest/tests/unit/core
65   functest/tests/unit/odl
66   functest/tests/unit/utils/test_decorators.py
67 commands = nosetests {[testenv:py35]dirs}
68
69 [testenv:cover]
70 basepython = python2.7
71 dirs =
72   functest/tests/unit/core
73   functest/tests/unit/odl
74   functest/tests/unit/utils/test_decorators.py
75 commands = nosetests --with-coverage --cover-tests \
76   --cover-package functest.core \
77   --cover-package functest.opnfv_tests.sdn.odl \
78   --cover-package functest.tests.unit \
79   --cover-package functest.utils.decorators \
80   --cover-min-percentage 100 {[testenv:cover]dirs}
81
82 [testenv:perm]
83 basepython = python2.7
84 whitelist_externals = bash
85 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
86 commands =
87   bash -c "\
88     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
89     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
90   bash -c "\
91     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"