8ec57fa3712e01b8a3949f4f04d59d496142225d
[functest.git] / tox.ini
1 [tox]
2 envlist = docs,pep8,pylint,yamllint,bashate,py35,py27,perm,cover
3
4 [testenv]
5 usedevelop = True
6 deps =
7   -c{toxinidir}/upper-constraints.txt
8   -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master}
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   --with-html-output \
19   functest/tests/unit
20
21 [testenv:docs]
22 basepython = python2.7
23 commands =
24   doc8 \
25     --ignore-path api/build \
26     --ignore-path docs/release/release-notes/build \
27     --ignore-path docs/testing/developer/devguide/build \
28     --ignore-path docs/testing/user/configguide/build \
29     --ignore-path docs/testing/user/userguide/build \
30     api \
31     docs/release/release-notes \
32     docs/testing/user/configguide \
33     docs/testing/user/userguide
34   sphinx-build -W -b html api/ api/build
35   sphinx-build -W -n -b html docs/release/release-notes docs/release/release-notes/build/html
36   sphinx-build -W -n -b html docs/testing/developer/devguide docs/testing/developer/devguide/build/html
37   sphinx-build -W -n -b html docs/testing/user/configguide docs/testing/user/configguide/build/html
38   sphinx-build -W -n -b html docs/testing/user/userguide docs/testing/user/userguide/build/html
39   sphinx-build -W -n -b linkcheck docs docs/_build/linkcheck
40   sphinx-build -W -n -b html docs docs/_build/html
41
42 [testenv:pep8]
43 basepython = python2.7
44 commands = flake8
45
46 [testenv:pylint]
47 basepython = python2.7
48 whitelist_externals = bash
49 modules =
50   functest.ci
51   functest.opnfv_tests.openstack.cinder
52   functest.opnfv_tests.openstack.rally
53   functest.opnfv_tests.openstack.refstack
54   functest.opnfv_tests.openstack.snaps
55   functest.opnfv_tests.openstack.tempest
56   functest.opnfv_tests.openstack.vmtp
57   functest.opnfv_tests.openstack.vping
58   functest.opnfv_tests.sdn.odl
59   functest.opnfv_tests.vnf.router
60   functest.tests.unit.ci
61   functest.tests.unit.odl
62   functest.tests.unit.openstack.rally
63   functest.tests.unit.openstack.snaps
64   functest.tests.unit.openstack.tempest
65   functest.tests.unit.openstack.vmtp
66   functest.tests.unit.openstack.vping
67   functest.tests.unit.vnf.router
68   functest.tests.unit.utils
69   functest.utils.config
70   functest.utils.constants
71   functest.utils.env
72   functest.utils.functest_utils
73 commands =
74   bash -c "\
75     pylint -f parseable \
76         --ignore-imports=y \
77         --disable=locally-disabled functest | tee pylint.out"
78   pylint --reports=n --errors-only functest
79   pylint --disable=locally-disabled \
80     --disable=duplicate-code \
81     --ignore-imports=y --reports=n {[testenv:pylint]modules}
82
83 [testenv:yamllint]
84 basepython = python2.7
85 files =
86   .travis.yml
87   ci
88   docker
89   functest/ci
90   functest/opnfv_tests/openstack/rally/rally_jobs.yaml
91   functest/opnfv_tests/vnf
92 commands =
93   yamllint -s {[testenv:yamllint]files}
94
95 [testenv:py35]
96 dirs =
97   functest/tests/unit/ci
98   functest/tests/unit/odl
99   functest/tests/unit/openstack
100   functest/tests/unit/vnf/epc
101   functest/tests/unit/utils
102 commands = nosetests {[testenv:py35]dirs}
103
104 [testenv:bashate]
105 basepython = python2.7
106 files =
107   functest/opnfv_tests/openstack/cinder/write_data.sh
108   functest/opnfv_tests/openstack/cinder/read_data.sh
109   functest/ci/add_proxy.sh
110   functest/ci/convert_images.sh
111   functest/ci/download_images.sh
112   build.sh
113 commands = bashate {[testenv:bashate]files}
114
115 [testenv:cover]
116 basepython = python2.7
117 dirs =
118   functest/tests/unit/ci
119   functest/tests/unit/odl
120   functest/tests/unit/openstack/vping
121   functest/tests/unit/openstack/cinder
122 commands = nosetests --with-coverage --cover-tests \
123   --cover-package functest.ci.check_deployment \
124   --cover-package functest.opnfv_tests.sdn.odl \
125   --cover-package functest.opnfv_tests.openstack.vping.vping_ssh \
126   --cover-package functest.opnfv_tests.openstack.cinder.cinder_test \
127   --cover-package functest.tests.unit \
128   --cover-min-percentage 100 {[testenv:cover]dirs}
129
130 [testenv:perm]
131 basepython = python2.7
132 whitelist_externals = bash
133 path=. -not -path './.tox/*' -not -path './.git/*' -not -path './docs/com/pres/reveal.js/*'
134 commands =
135   bash -c "\
136     find {[testenv:perm]path} \( -type f -not -perm 644 -o -type d -not -perm 755 \) \
137     -exec ls -l \{\} + | grep '.' && exit 1 || exit 0"
138   bash -c "\
139     find {[testenv:perm]path} -exec file \{\} + | grep CRLF && exit 1 || exit 0"