blob: 82080667ec379bb369ca82309f0058fd764e4c8e [file] [log] [blame]
Jay Pipesa6aa5f22012-07-24 19:40:29 -04001[tox]
Masayuki Igawa80d30b82018-09-03 17:25:49 +09002envlist = pep8,py36,py27,pip-check-reqs
Ghanshyam3a59e1e2016-01-14 17:15:29 +09003minversion = 2.3.1
Matthew Treinish7228e112013-10-03 14:58:54 +00004skipsdist = True
Jay Pipesa6aa5f22012-07-24 19:40:29 -04005
Matthew Treinish5b7626a2014-09-23 17:39:38 -04006[tempestenv]
Joe Gordon9f1612e2015-01-28 11:23:43 -08007sitepackages = False
Masayuki Igawad81d3ce2016-04-20 15:00:54 +09008setenv =
9 VIRTUAL_ENV={envdir}
10 OS_TEST_PATH=./tempest/test_discover
11deps =
Andreas Jaeger880d9432017-12-01 07:38:54 +010012 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090013 -r{toxinidir}/requirements.txt
Matthew Treinish5b7626a2014-09-23 17:39:38 -040014
15[testenv]
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090016setenv =
17 VIRTUAL_ENV={envdir}
Andrea Frittoli8f018cb2017-08-11 14:36:18 +010018 OS_LOG_CAPTURE=1
Matthew Treinish5cc92892018-02-22 15:53:47 -050019 OS_STDOUT_CAPTURE=1
20 OS_STDERR_CAPTURE=1
21 OS_TEST_TIMEOUT=160
Stephen Finucanea6353c42018-07-06 14:00:36 +010022 PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
Masayuki Igawad0b8ebd2017-09-14 14:51:25 -060023passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH TEMPEST_CONFIG TEMPEST_CONFIG_DIR http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY ZUUL_CACHE_DIR REQUIREMENTS_PIP_LOCATION GENERATE_TEMPEST_PLUGIN_LIST
Matthew Treinish7228e112013-10-03 14:58:54 +000024usedevelop = True
Andreas Jaeger880d9432017-12-01 07:38:54 +010025install_command = pip install {opts} {packages}
Matthew Treinish5b7626a2014-09-23 17:39:38 -040026whitelist_externals = *
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090027deps =
Andreas Jaeger880d9432017-12-01 07:38:54 +010028 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090029 -r{toxinidir}/requirements.txt
30 -r{toxinidir}/test-requirements.txt
Sean Daguec7b4d882014-11-25 08:18:23 -050031commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090032 find . -type f -name "*.pyc" -delete
Masayuki Igawad0b8ebd2017-09-14 14:51:25 -060033 stestr --test-path ./tempest/tests run {posargs}
Matthew Treinish12fdf4b2013-10-03 15:20:09 +000034
Jon Grimm270bd7f2014-08-05 18:11:29 +000035[testenv:genconfig]
Matthew Treinishbdef1c72016-06-21 18:06:49 -040036commands = oslo-config-generator --config-file tempest/cmd/config-generator.tempest.conf
Jon Grimm270bd7f2014-08-05 18:11:29 +000037
Matthew Treinishb2f5cad2014-01-07 21:54:55 +000038[testenv:cover]
Matthew Treinish069d8282017-11-28 19:19:27 -050039setenv =
40 {[testenv]setenv}
41 PYTHON=coverage run --source tempest --parallel-mode
42commands =
43 coverage erase
44 find . -type f -name "*.pyc" -delete
45 stestr --test-path ./tempest/tests run {posargs}
46 coverage combine
47 coverage html -d cover
48 coverage xml -o cover/coverage.xml
49 coverage report
Matthew Treinishb2f5cad2014-01-07 21:54:55 +000050
Giampaolo Lauria7a3e0042013-06-07 14:59:19 -040051[testenv:all]
Matthew Treinish0e25a902016-04-29 16:38:51 -040052envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -040053sitepackages = {[tempestenv]sitepackages}
David Kranzf9695d22014-10-27 11:43:52 -040054# 'all' includes slow tests
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090055setenv =
56 {[tempestenv]setenv}
57 OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
Matthew Treinish5b7626a2014-09-23 17:39:38 -040058deps = {[tempestenv]deps}
Giampaolo Lauria7a3e0042013-06-07 14:59:19 -040059commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090060 find . -type f -name "*.pyc" -delete
Matthew Treinish68c78712016-07-28 14:47:27 -040061 tempest run --regex {posargs}
Matthew Treinish87af1bb2013-06-17 15:29:10 -040062
Marc Kodererc2f9b3a2015-07-27 15:19:08 +020063[testenv:all-plugin]
Andrea Frittoli35d12ca2018-02-13 15:42:25 +000064# DEPRECATED
65# NOTE(andreaf) The all-plugin tox env uses sitepackages
66# so that plugins installed outsite of Tempest virtual environment
67# can be discovered. After the implementation during the Queens
68# release cycle of the goal of moving Tempest plugins in dedicated
69# git repos, this environment should not be used anymore. "all"
70# should be used instead with the appropriate regex filtering.
71sitepackages = True
72# 'all' includes slow tests
73setenv =
74 {[tempestenv]setenv}
75 OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
76deps = {[tempestenv]deps}
77commands =
78 echo "WARNING: The all-plugin env is deprecated and will be removed"
79 echo "WARNING Please use the 'all' environment for Tempest plugins."
80 find . -type f -name "*.pyc" -delete
81 tempest run --regex {posargs}
82
83[testenv:all-site-packages]
Marc Kodererc2f9b3a2015-07-27 15:19:08 +020084sitepackages = True
85# 'all' includes slow tests
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090086setenv =
87 {[tempestenv]setenv}
88 OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
Marc Kodererc2f9b3a2015-07-27 15:19:08 +020089deps = {[tempestenv]deps}
90commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090091 find . -type f -name "*.pyc" -delete
Matthew Treinish68c78712016-07-28 14:47:27 -040092 tempest run --regex {posargs}
Marc Kodererc2f9b3a2015-07-27 15:19:08 +020093
Monty Taylor8d4c90c2013-05-02 14:33:18 -040094[testenv:full]
Matthew Treinish0e25a902016-04-29 16:38:51 -040095envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -040096sitepackages = {[tempestenv]sitepackages}
97setenv = {[tempestenv]setenv}
98deps = {[tempestenv]deps}
Matthew Treinish59eb0b22013-08-07 15:48:21 -040099# The regex below is used to select which tests to run and exclude the slow tag:
Masayuki Igawa83522042015-12-01 16:51:34 +0900100# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
Masayuki Igawaac0b1712018-03-09 16:20:42 +0900101# FIXME: We can replace it with the `--black-regex` option to exclude tests now.
Matthew Treinish83d2ec42013-07-30 16:37:32 -0400102commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900103 find . -type f -name "*.pyc" -delete
Sean Dague49505df2017-03-01 11:35:58 -0500104 tempest run --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
105 tempest run --combine --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)' {posargs}
Matthew Treinish83d2ec42013-07-30 16:37:32 -0400106
Attila Fazekas3f219f52018-03-01 16:50:10 +0000107[testenv:full-parallel]
108envdir = .tox/tempest
109sitepackages = {[tempestenv]sitepackages}
110setenv = {[tempestenv]setenv}
111deps = {[tempestenv]deps}
112# The regex below is used to select all tempest scenario and including the non slow api tests
113commands =
114 find . -type f -name "*.pyc" -delete
115 tempest run --regex '(^tempest\.scenario.*)|(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
116
Matthew Treinish99288cd2014-02-10 09:21:51 -0500117[testenv:full-serial]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400118envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400119sitepackages = {[tempestenv]sitepackages}
120setenv = {[tempestenv]setenv}
121deps = {[tempestenv]deps}
Matthew Treinish99288cd2014-02-10 09:21:51 -0500122# The regex below is used to select which tests to run and exclude the slow tag:
Masayuki Igawa83522042015-12-01 16:51:34 +0900123# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
Masayuki Igawaac0b1712018-03-09 16:20:42 +0900124# FIXME: We can replace it with the `--black-regex` option to exclude tests now.
Matthew Treinish99288cd2014-02-10 09:21:51 -0500125commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900126 find . -type f -name "*.pyc" -delete
Masayuki Igawa730f59b2016-09-21 11:47:32 +0200127 tempest run --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))' {posargs}
Matthew Treinish99288cd2014-02-10 09:21:51 -0500128
Andrea Frittolib838af92017-03-06 15:11:13 +0000129[testenv:scenario]
130envdir = .tox/tempest
131sitepackages = {[tempestenv]sitepackages}
132setenv = {[tempestenv]setenv}
133deps = {[tempestenv]deps}
134# The regex below is used to select all scenario tests
135commands =
136 find . -type f -name "*.pyc" -delete
137 tempest run --serial --regex '(^tempest\.scenario)' {posargs}
138
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400139[testenv:smoke]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400140envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400141sitepackages = {[tempestenv]sitepackages}
142setenv = {[tempestenv]setenv}
143deps = {[tempestenv]deps}
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400144commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900145 find . -type f -name "*.pyc" -delete
Matthew Treinish68c78712016-07-28 14:47:27 -0400146 tempest run --regex '\[.*\bsmoke\b.*\]' {posargs}
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400147
Joe Gordond2796292013-11-14 12:55:55 -0800148[testenv:smoke-serial]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400149envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400150sitepackages = {[tempestenv]sitepackages}
151setenv = {[tempestenv]setenv}
152deps = {[tempestenv]deps}
Joe Gordond2796292013-11-14 12:55:55 -0800153# This is still serial because neutron doesn't work with parallel. See:
154# https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
155# job would fail if we moved it to parallel.
156commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900157 find . -type f -name "*.pyc" -delete
Matthew Treinish68c78712016-07-28 14:47:27 -0400158 tempest run --serial --regex '\[.*\bsmoke\b.*\]' {posargs}
Joe Gordond2796292013-11-14 12:55:55 -0800159
ghanshyam10326c72018-08-01 08:53:00 +0000160[testenv:slow-serial]
161envdir = .tox/tempest
162sitepackages = {[tempestenv]sitepackages}
163setenv = {[tempestenv]setenv}
164deps = {[tempestenv]deps}
165# The regex below is used to select the slow tagged tests to run serially:
166commands =
167 find . -type f -name "*.pyc" -delete
168 tempest run --serial --regex '\[.*\bslow\b.*\]' {posargs}
169
Sean Dagueb56052b2013-05-21 17:57:41 -0400170[testenv:venv]
Matt Riedemannd5e92822018-01-25 11:25:57 -0500171deps =
172 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
173 -r{toxinidir}/requirements.txt
174 -r{toxinidir}/doc/requirements.txt
Sean Dagueb56052b2013-05-21 17:57:41 -0400175commands = {posargs}
Sean Dagueb56052b2013-05-21 17:57:41 -0400176
Matthew Treinish0e25a902016-04-29 16:38:51 -0400177[testenv:venv-tempest]
178envdir = .tox/tempest
179sitepackages = {[tempestenv]sitepackages}
180setenv = {[tempestenv]setenv}
181deps = {[tempestenv]deps}
182commands = {posargs}
183
Matthew Treinish8bd013e2014-06-18 21:58:32 -0400184[testenv:docs]
junboli173b11c2018-01-15 11:25:35 +0800185deps =
186 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
187 -r{toxinidir}/requirements.txt
188 -r{toxinidir}/doc/requirements.txt
Mathew Oddenb389faa2015-07-30 20:24:08 +0000189commands =
junboli173b11c2018-01-15 11:25:35 +0800190 rm -rf doc/build
Ihar Hrachyshka8032b2e2017-11-27 14:16:59 -0800191 sphinx-build -W -b html doc/source doc/build/html
junboli173b11c2018-01-15 11:25:35 +0800192whitelist_externals = rm
Matthew Treinish8bd013e2014-06-18 21:58:32 -0400193
Jay Pipesa6aa5f22012-07-24 19:40:29 -0400194[testenv:pep8]
Matthew Treinish3d468112013-10-24 21:49:14 +0000195commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900196 flake8 {posargs}
197 check-uuid
Matthew Treinish3d468112013-10-24 21:49:14 +0000198
Chris Hoge7579c1a2015-02-26 14:12:15 -0800199[testenv:uuidgen]
200commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900201 check-uuid --fix
Chris Hoge296558c2015-02-19 00:29:49 -0600202
Giampaolo Lauria1b837ce2013-05-01 11:22:07 -0400203[hacking]
Giampaolo Lauriad50c27d2013-05-23 15:23:12 -0400204local-check-factory = tempest.hacking.checks.factory
Matthew Treinish2b6db0c2014-05-17 10:42:36 -0400205import_exceptions = tempest.services
Giampaolo Lauria1b837ce2013-05-01 11:22:07 -0400206
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700207[flake8]
Joe Gordondca03dd2013-07-18 14:10:19 -0700208# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/
Matthew Treinish96e9e882014-06-09 18:37:19 -0400209# E123 skipped because it is ignored by default in the default pep8
Matthew Treinish1d14c542014-06-17 20:25:40 -0400210# E129 skipped because it is too limiting when combined with other rules
Stephen Finucanefc42cc62018-07-06 13:39:55 +0100211# W504 skipped because it is overeager and unnecessary
212ignore = E125,E123,E129,W504
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700213show-source = True
junboli8bd00e32017-08-22 17:06:15 +0800214exclude = .git,.venv,.tox,dist,doc,*egg,build
Jordan Pittier525ec712016-12-07 17:51:26 +0100215enable-extensions = H106,H203,H904
Masayuki Igawa134d9f72017-02-10 18:05:26 +0900216import-order-style = pep8
Andrea Frittoli (andreaf)897ecfb2016-02-23 10:12:48 -0500217
218[testenv:releasenotes]
junboli173b11c2018-01-15 11:25:35 +0800219deps =
220 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
221 -r{toxinidir}/requirements.txt
222 -r{toxinidir}/doc/requirements.txt
junboli8bd00e32017-08-22 17:06:15 +0800223commands =
junboli173b11c2018-01-15 11:25:35 +0800224 rm -rf releasenotes/build
225 sphinx-build -a -E -W -d releasenotes/build/doctrees \
226 -b html releasenotes/source releasenotes/build/html
227whitelist_externals = rm
Jordan Pittiercefaa2b2016-07-22 13:04:26 +0200228
229[testenv:pip-check-reqs]
230# Do not install test-requirements as that will pollute the virtualenv for
231# determining missing packages.
232# This also means that pip-check-reqs must be installed separately, outside
233# of the requirements.txt files
234deps = pip_check_reqs
235 -r{toxinidir}/requirements.txt
236commands=
237 pip-extra-reqs -d --ignore-file=tempest/tests/* tempest
238 pip-missing-reqs -d --ignore-file=tempest/tests/* tempest
Chandan Kumarac5c5532016-11-30 18:49:26 +0530239
240
241[testenv:bindep]
242# Do not install any requirements. We want this to be fast and work even if
243# system dependencies are missing, since it's used to tell you what system
244# dependencies are missing! This also means that bindep must be installed
245# separately, outside of the requirements files.
246deps = bindep
247commands = bindep test
Chandan Kumarb7affe42017-06-29 13:57:01 +0530248
249[testenv:plugin-sanity-check]
250# perform tempest plugin sanity
251whitelist_externals = bash
252commands =
253 bash tools/tempest-plugin-sanity.sh