]> review.fuel-infra Code Review - openstack-build/neutron-build.git/blob - tox.ini
Merge "Add support for neutron-full and api jobs using pecan to gate_hook"
[openstack-build/neutron-build.git] / tox.ini
1 [tox]
2 envlist = docs,py34,py27,pep8
3 minversion = 2.3
4 skipsdist = True
5
6 [testenv]
7 setenv = VIRTUAL_ENV={envdir}
8 passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
9 usedevelop = True
10 install_command =
11                   constraints: {[testenv:common-constraints]install_command}
12                   pip install -U {opts} {packages}
13 deps = -r{toxinidir}/requirements.txt
14        -r{toxinidir}/test-requirements.txt
15 whitelist_externals = sh
16 commands =
17   dsvm-functional: {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
18   {toxinidir}/tools/ostestr_compat_shim.sh {posargs}
19 # there is also secret magic in ostestr which lets you run in a fail only
20 # mode. To do this define the TRACE_FAILONLY environmental variable.
21
22 [testenv:api]
23 basepython = python2.7
24 passenv = {[testenv]passenv} TEMPEST_CONFIG_DIR
25 setenv = {[testenv]setenv}
26          OS_TEST_PATH=./neutron/tests/api
27          TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
28          OS_TEST_API_WITH_REST=1
29
30 [testenv:api-constraints]
31 basepython = {[testenv:api]basepython}
32 install_command = {[testenv:common-constraints]install_command}
33 passenv = {[testenv:api]passenv}
34 setenv = {[testenv:api]setenv}
35
36 [testenv:common]
37 # Fake job to define environment variables shared between dsvm/non-dsvm jobs
38 setenv = OS_TEST_TIMEOUT=180
39 commands = false
40
41 [testenv:common-constraints]
42 install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
43
44 [testenv:dsvm]
45 # Fake job to define environment variables shared between dsvm jobs
46 setenv = OS_SUDO_TESTING=1
47          OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
48          OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
49          OS_FAIL_ON_MISSING_DEPS=1
50 commands = false
51
52 [testenv:functional]
53 basepython = python2.7
54 setenv = {[testenv]setenv}
55          {[testenv:common]setenv}
56          OS_TEST_PATH=./neutron/tests/functional
57 deps =
58   {[testenv]deps}
59   -r{toxinidir}/neutron/tests/functional/requirements.txt
60
61 [testenv:functional-constraints]
62 basepython = {[testenv:functional]basepython}
63 install_command = {[testenv:common-constraints]install_command}
64 setenv = {[testenv:functional]setenv}
65 deps =
66   {[testenv:functional]deps}
67
68 [testenv:functional-py34]
69 basepython = python3.4
70 setenv = {[testenv:functional]setenv}
71 deps =
72   {[testenv:functional]deps}
73
74 [testenv:dsvm-functional]
75 basepython = python2.7
76 setenv = {[testenv:functional]setenv}
77          {[testenv:dsvm]setenv}
78 sitepackages=True
79 deps =
80   {[testenv:functional]deps}
81
82 [testenv:dsvm-functional-constraints]
83 basepython = {[testenv:dsvm-functional]basepython}
84 install_command = {[testenv:common-constraints]install_command}
85 setenv = {[testenv:dsvm-functional]setenv}
86 sitepackages={[testenv:dsvm-functional]sitepackages}
87 deps =
88   {[testenv:functional-constraints]deps}
89
90 [testenv:dsvm-functional-py34]
91 basepython = python3.4
92 setenv = {[testenv:dsvm-functional]setenv}
93 sitepackages={[testenv:dsvm-functional]sitepackages}
94 deps =
95   {[testenv:dsvm-functional]deps}
96
97 [testenv:dsvm-fullstack]
98 setenv = {[testenv]setenv}
99          {[testenv:common]setenv}
100          {[testenv:dsvm]setenv}
101          OS_TEST_PATH=./neutron/tests/fullstack
102 sitepackages=True
103 deps =
104   {[testenv:functional]deps}
105
106 [testenv:dsvm-fullstack-constraints]
107 install_command = {[testenv:common-constraints]install_command}
108 setenv =
109   {[testenv:dsvm-fullstack]setenv}
110 sitepackages={[testenv:dsvm-fullstack]sitepackages}
111 deps =
112   {[testenv:functional-constraints]deps}
113
114 [testenv:releasenotes]
115 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
116
117 [testenv:pep8]
118 basepython = python2.7
119 deps =
120   {[testenv]deps}
121 commands=
122   # If it is easier to add a check via a shell script, consider adding it in this file
123   sh ./tools/misc-sanity-checks.sh
124   {toxinidir}/tools/check_unit_test_structure.sh
125   # Checks for coding and style guidelines
126   flake8
127   sh ./tools/coding-checks.sh --pylint '{posargs}'
128   neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
129   {[testenv:genconfig]commands}
130 whitelist_externals =
131   sh
132   bash
133
134 [testenv:pep8-constraints]
135 basepython = {[testenv:pep8]basepython}
136 install_command = {[testenv:common-constraints]install_command}
137 deps =
138   {[testenv]deps}
139 commands=
140   # If it is easier to add a check via a shell script, consider adding it in this file
141   sh ./tools/misc-sanity-checks.sh
142   {toxinidir}/tools/check_unit_test_structure.sh
143   # Checks for coding and style guidelines
144   flake8
145   sh ./tools/coding-checks.sh --pylint '{posargs}'
146   neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
147   {[testenv:genconfig]commands}
148 whitelist_externals = {[testenv:pep8]whitelist_externals}
149
150 [testenv:cover]
151 basepython = python2.7
152 commands =
153   python setup.py testr --coverage --testr-args='{posargs}'
154   coverage report
155
156 [testenv:cover-constraints]
157 basepython = {[testenv:cover]basepython}
158 install_command = {[testenv:common-constraints]install_command}
159 commands =
160   python setup.py testr --coverage --testr-args='{posargs}'
161
162 [testenv:venv]
163 commands = {posargs}
164
165 [testenv:venv-constraints]
166 install_command = {[testenv:common-constraints]install_command}
167 commands = {posargs}
168
169 [testenv:docs]
170 commands = sphinx-build -W -b html doc/source doc/build/html
171
172 [testenv:docs-constraints]
173 install_command = {[testenv:common-constraints]install_command}
174 commands = {[testenv:docs]commands}
175
176 [flake8]
177 # E125 continuation line does not distinguish itself from next logical line
178 # E126 continuation line over-indented for hanging indent
179 # E128 continuation line under-indented for visual indent
180 # E129 visually indented line with same indent as next logical line
181 # E265 block comment should start with ‘# ‘
182 # H404 multi line docstring should start with a summary
183 # H405 multi line docstring summary not separated with an empty line
184 ignore = E125,E126,E128,E129,E265,H404,H405
185 show-source = true
186 builtins = _
187 # neutron/tests/tempest needs to be excluded so long as it continues
188 # to be copied directly from tempest, since tempest and neutron do not
189 # share a flake8 configuration.
190 exclude = ./.*,build,dist,neutron/openstack/common/*,neutron/tests/tempest
191
192 [hacking]
193 import_exceptions = neutron.i18n, neutron._i18n
194 local-check-factory = neutron.hacking.checks.factory
195
196 [testenv:genconfig]
197 commands = {toxinidir}/tools/generate_config_file_samples.sh