Fix Functest Developer Guide
[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 =
23   doc8 \
24     --ignore-path docs/release/release-notes/build \
25     --ignore-path docs/testing/developer/devguide/build \
26     --ignore-path docs/testing/user/configguide/build \
27     --ignore-path docs/testing/user/userguide/build \
28     docs/release/release-notes \
29     docs/testing/user/configguide \
30     docs/testing/user/userguide
31   sphinx-build -W -b html api/ api/_build
32   sphinx-build -W -b html docs/release/release-notes docs/release/release-notes/build/html
33   sphinx-build -W -b html docs/testing/developer/devguide docs/testing/developer/devguide/build/html
34   sphinx-build -W -b html docs/testing/user/configguide docs/testing/user/configguide/build/html
35   sphinx-build -W -b html docs/testing/user/userguide docs/testing/user/userguide/build/html
36
37 [testenv:pep8]
38 basepython = python2.7
39 commands = flake8
40
41 [testenv:pylint]
42 basepython = python2.7
43 whitelist_externals = bash
44 modules =
45   functest.api
46   functest.ci
47   functest.cli
48   functest.opnfv_tests.openstack.rally
49   functest.opnfv_tests.openstack.refstack
50   functest.opnfv_tests.openstack.snaps
51   functest.opnfv_tests.openstack.tempest
52   functest.opnfv_tests.openstack.vping
53   functest.opnfv_tests.sdn.odl
54   functest.opnfv_tests.vnf.router
55   functest.tests.unit.ci
56   functest.tests.unit.cli
57   functest.tests.unit.odl
58   functest.tests.unit.openstack.rally
59   functest.tests.unit.openstack.snaps
60   functest.tests.unit.openstack.tempest
61   functest.tests.unit.openstack.vping
62   functest.tests.unit.vnf.router
63   functest.tests.unit.utils
64   functest.utils.config
65   functest.utils.constants
66   functest.utils.env
67   functest.utils.functest_utils
68 commands =
69   bash -c "\
70     pylint -f parseable --ignore-imports=y --disable=locally-disabled functest | \
71     tee pylint.out | sed -ne '/Raw metrics/,//p'"
72   pylint --reports=n --errors-only functest
73   pylint --disable=locally-disabled \
74     --disable=duplicate-code \
75     --ignore-imports=y --reports=n {[testenv:pylint]modules}
76
77 [testenv:yamllint]
78 basepython = python2.7
79 files =
80   docker
81   functest/api
82   functest/ci
83   functest/opnfv_tests/vnf
84 commands =
85   yamllint -s {[testenv:yamllint]files}
86
87 [testenv:py35]
88 dirs =
89   functest/tests/unit/ci
90   functest/tests/unit/cli
91   functest/tests/unit/odl
92   functest/tests/unit/utils
93 commands = nosetests {[testenv:py35]dirs}
94
95 [testenv:cover]
96 basepython = python2.7
97 dirs =
98   functest/tests/unit/ci
99   functest/tests/unit/odl
100 commands = nosetests --with-coverage --cover-tests \
101   --cover-package functest.ci.check_deployment \
102   --cover-package functest.opnfv_tests.sdn.odl \
103   --cover-package functest.tests.unit \
104   --cover-min-percentage 100 {[testenv:cover]dirs}
105
106 [testenv:perm]
107 basepython = python2.7
108 whitelist_externals = bash
109 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
110 commands =
111   bash -c "\
112     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
113     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
114   bash -c "\
115     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"