blob: 7c50a3bb5fb4b55ebb619072452544e1e3c82eaf [file] [log] [blame]
Jay Pipesa6aa5f22012-07-24 19:40:29 -04001[tox]
Ghanshyam Mann87661fc2022-05-28 19:00:24 -05002envlist = pep8,py39,bashate,pip-check-reqs
Martin Kopecdc844232020-12-24 15:57:53 +00003minversion = 3.18.0
Jay Pipesa6aa5f22012-07-24 19:40:29 -04004
Matthew Treinish5b7626a2014-09-23 17:39:38 -04005[tempestenv]
Joe Gordon9f1612e2015-01-28 11:23:43 -08006sitepackages = False
Masayuki Igawad81d3ce2016-04-20 15:00:54 +09007setenv =
8 VIRTUAL_ENV={envdir}
9 OS_TEST_PATH=./tempest/test_discover
Ghanshyam40b51c52020-01-19 19:31:11 -060010 OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090011deps =
Ghanshyam Mann6a122ea2023-09-26 18:53:17 -070012 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
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
Ghanshyam Mannea6644c2022-12-24 19:00:35 -080023passenv =
24 OS_STDOUT_CAPTURE
25 OS_STDERR_CAPTURE
26 OS_TEST_TIMEOUT
27 OS_TEST_LOCK_PATH
28 TEMPEST_CONFIG
29 TEMPEST_CONFIG_DIR
30 http_proxy
31 HTTP_PROXY
32 https_proxy
33 HTTPS_PROXY
34 no_proxy
35 NO_PROXY
36 ZUUL_CACHE_DIR
37 REQUIREMENTS_PIP_LOCATION
38 GENERATE_TEMPEST_PLUGIN_LIST
Matthew Treinish7228e112013-10-03 14:58:54 +000039usedevelop = True
Clark Boylana673bd92022-11-22 09:30:23 -080040allowlist_externals =
41 find
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090042deps =
Ghanshyam Mann6a122ea2023-09-26 18:53:17 -070043 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090044 -r{toxinidir}/requirements.txt
45 -r{toxinidir}/test-requirements.txt
Sean Daguec7b4d882014-11-25 08:18:23 -050046commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090047 find . -type f -name "*.pyc" -delete
Masayuki Igawad0b8ebd2017-09-14 14:51:25 -060048 stestr --test-path ./tempest/tests run {posargs}
Matthew Treinish12fdf4b2013-10-03 15:20:09 +000049
Jon Grimm270bd7f2014-08-05 18:11:29 +000050[testenv:genconfig]
Matthew Treinishbdef1c72016-06-21 18:06:49 -040051commands = oslo-config-generator --config-file tempest/cmd/config-generator.tempest.conf
Jon Grimm270bd7f2014-08-05 18:11:29 +000052
Matthew Treinishb2f5cad2014-01-07 21:54:55 +000053[testenv:cover]
Matthew Treinish069d8282017-11-28 19:19:27 -050054setenv =
55 {[testenv]setenv}
56 PYTHON=coverage run --source tempest --parallel-mode
57commands =
58 coverage erase
59 find . -type f -name "*.pyc" -delete
60 stestr --test-path ./tempest/tests run {posargs}
61 coverage combine
62 coverage html -d cover
63 coverage xml -o cover/coverage.xml
Katarina Strenkova433dbdc2023-08-29 15:17:57 +000064 coverage report -m --fail-under=76
Matthew Treinishb2f5cad2014-01-07 21:54:55 +000065
Manik Bindlish8a7aaa52018-11-30 10:22:30 +000066[testenv:debug]
Manik Bindlish8a7aaa52018-11-30 10:22:30 +000067commands = oslo_debug_helper -t tempest/tests {posargs}
68
Giampaolo Lauria7a3e0042013-06-07 14:59:19 -040069[testenv:all]
Matthew Treinish0e25a902016-04-29 16:38:51 -040070envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -040071sitepackages = {[tempestenv]sitepackages}
David Kranzf9695d22014-10-27 11:43:52 -040072# 'all' includes slow tests
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090073setenv =
74 {[tempestenv]setenv}
Matthew Treinish5b7626a2014-09-23 17:39:38 -040075deps = {[tempestenv]deps}
Giampaolo Lauria7a3e0042013-06-07 14:59:19 -040076commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +090077 find . -type f -name "*.pyc" -delete
Masayuki Igawafe0de682019-05-21 17:04:28 +090078 tempest run --regex {posargs:''}
Matthew Treinish87af1bb2013-06-17 15:29:10 -040079
Marc Kodererc2f9b3a2015-07-27 15:19:08 +020080[testenv:all-plugin]
Andrea Frittoli35d12ca2018-02-13 15:42:25 +000081# DEPRECATED
82# NOTE(andreaf) The all-plugin tox env uses sitepackages
83# so that plugins installed outsite of Tempest virtual environment
84# can be discovered. After the implementation during the Queens
85# release cycle of the goal of moving Tempest plugins in dedicated
86# git repos, this environment should not be used anymore. "all"
87# should be used instead with the appropriate regex filtering.
88sitepackages = True
89# 'all' includes slow tests
90setenv =
91 {[tempestenv]setenv}
Andrea Frittoli35d12ca2018-02-13 15:42:25 +000092deps = {[tempestenv]deps}
93commands =
94 echo "WARNING: The all-plugin env is deprecated and will be removed"
95 echo "WARNING Please use the 'all' environment for Tempest plugins."
96 find . -type f -name "*.pyc" -delete
Masayuki Igawafe0de682019-05-21 17:04:28 +090097 tempest run --regex {posargs:''}
Andrea Frittoli35d12ca2018-02-13 15:42:25 +000098
99[testenv:all-site-packages]
Marc Kodererc2f9b3a2015-07-27 15:19:08 +0200100sitepackages = True
101# 'all' includes slow tests
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900102setenv =
103 {[tempestenv]setenv}
Marc Kodererc2f9b3a2015-07-27 15:19:08 +0200104deps = {[tempestenv]deps}
105commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900106 find . -type f -name "*.pyc" -delete
Masayuki Igawafe0de682019-05-21 17:04:28 +0900107 tempest run --regex {posargs:''}
Marc Kodererc2f9b3a2015-07-27 15:19:08 +0200108
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400109[testenv:full]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400110envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400111sitepackages = {[tempestenv]sitepackages}
112setenv = {[tempestenv]setenv}
113deps = {[tempestenv]deps}
Matthew Treinish59eb0b22013-08-07 15:48:21 -0400114# The regex below is used to select which tests to run and exclude the slow tag:
Masayuki Igawa83522042015-12-01 16:51:34 +0900115# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
Martin Kopecdc844232020-12-24 15:57:53 +0000116# FIXME: We can replace it with the `--exclude-regex` option to exclude tests now.
Matthew Treinish83d2ec42013-07-30 16:37:32 -0400117commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900118 find . -type f -name "*.pyc" -delete
Sean Dague49505df2017-03-01 11:35:58 -0500119 tempest run --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
Balazs Gibizerdfb30432021-12-14 17:25:16 +0100120 tempest run --combine --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)' {posargs}
Matthew Treinish83d2ec42013-07-30 16:37:32 -0400121
Ghanshyam Mann518e4262023-02-10 19:57:36 -0600122[testenv:integrated-full]
123envdir = .tox/tempest
124sitepackages = {[tempestenv]sitepackages}
Ghanshyam Mann518e4262023-02-10 19:57:36 -0600125setenv = {[tempestenv]setenv}
126deps = {[tempestenv]deps}
127# The regex below is used to select which tests to run. It exclude the extra
128# tests mentioned in tools/tempest-extra-tests-list.txt and slow tag:
129# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
130# FIXME: We can replace it with the `--exclude-regex` option to exclude tests now.
131regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
132regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
133commands =
134 find . -type f -name "*.pyc" -delete
135 tempest run --regex {[testenv:integrated-full]regex1} --exclude-list ./tools/tempest-extra-tests-list.txt {posargs}
136 tempest run --combine --serial --regex {[testenv:integrated-full]regex2} {posargs}
137
138[testenv:extra-tests]
139envdir = .tox/tempest
140sitepackages = {[tempestenv]sitepackages}
Ghanshyam Mann518e4262023-02-10 19:57:36 -0600141setenv = {[tempestenv]setenv}
142deps = {[tempestenv]deps}
143# The regex below is used to select extra tests mentioned in
144# tools/tempest-extra-tests-list.txt and exclude slow tag tests:
145# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
146# FIXME: We can replace it with the `--exclude-regex` option to exclude tests now.
147exclude-regex = '\[.*\bslow\b.*\]'
148commands =
149 find . -type f -name "*.pyc" -delete
150 tempest run --exclude-regex {[testenv:extra-tests]exclude-regex} --include-list ./tools/tempest-extra-tests-list.txt {posargs}
151
Attila Fazekas3f219f52018-03-01 16:50:10 +0000152[testenv:full-parallel]
153envdir = .tox/tempest
154sitepackages = {[tempestenv]sitepackages}
155setenv = {[tempestenv]setenv}
156deps = {[tempestenv]deps}
Ghanshyam Mann518e4262023-02-10 19:57:36 -0600157# But exlcude the extra tests mentioned in tools/tempest-extra-tests-list.txt
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000158regex = '(^tempest\.scenario.*)|(^tempest\.serial_tests)|(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
Attila Fazekas3f219f52018-03-01 16:50:10 +0000159commands =
160 find . -type f -name "*.pyc" -delete
Ghanshyam Mann518e4262023-02-10 19:57:36 -0600161 tempest run --regex {[testenv:full-parallel]regex} --exclude-list ./tools/tempest-extra-tests-list.txt {posargs}
Attila Fazekas3f219f52018-03-01 16:50:10 +0000162
Ghanshyam Mannba28d782021-09-03 10:21:54 -0500163[testenv:api-microversion-tests]
164envdir = .tox/tempest
165sitepackages = {[tempestenv]sitepackages}
Ghanshyam Mannba28d782021-09-03 10:21:54 -0500166setenv = {[tempestenv]setenv}
167deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000168regex = '(^tempest\.api\.compute)|(^tempest\.api\.volume)'
Ghanshyam Mannba28d782021-09-03 10:21:54 -0500169# The regex below is used to select all tempest api tests for services having API
170# microversion concept.
171commands =
172 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000173 tempest run --regex {[testenv:api-microversion-tests]regex} {posargs}
Ghanshyam Mannba28d782021-09-03 10:21:54 -0500174
Ghanshyam5072a242019-07-03 14:40:53 +0000175[testenv:integrated-network]
176envdir = .tox/tempest
177sitepackages = {[tempestenv]sitepackages}
178setenv = {[tempestenv]setenv}
179deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000180regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
181regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
Ghanshyam5072a242019-07-03 14:40:53 +0000182# The regex below is used to select which tests to run and exclude the slow tag and
Martin Kopecdc844232020-12-24 15:57:53 +0000183# tests listed in exclude-list file:
Ghanshyam5072a242019-07-03 14:40:53 +0000184commands =
185 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000186 tempest run --regex {[testenv:integrated-network]regex1} --exclude-list ./tools/tempest-integrated-gate-networking-exclude-list.txt {posargs}
187 tempest run --combine --serial --regex {[testenv:integrated-network]regex2} --exclude-list ./tools/tempest-integrated-gate-networking-exclude-list.txt {posargs}
Ghanshyam5072a242019-07-03 14:40:53 +0000188
Ghanshyamee7fd1f2019-07-05 09:36:57 +0000189[testenv:integrated-compute]
190envdir = .tox/tempest
191sitepackages = {[tempestenv]sitepackages}
192setenv = {[tempestenv]setenv}
193deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000194regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
195regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
Ghanshyamee7fd1f2019-07-05 09:36:57 +0000196# The regex below is used to select which tests to run and exclude the slow tag and
Martin Kopecdc844232020-12-24 15:57:53 +0000197# tests listed in exclude-list file:
Ghanshyamee7fd1f2019-07-05 09:36:57 +0000198commands =
199 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000200 tempest run --regex {[testenv:integrated-compute]regex1} --exclude-list ./tools/tempest-integrated-gate-compute-exclude-list.txt {posargs}
201 tempest run --combine --serial --regex {[testenv:integrated-compute]regex2} --exclude-list ./tools/tempest-integrated-gate-compute-exclude-list.txt {posargs}
Ghanshyamee7fd1f2019-07-05 09:36:57 +0000202
Ghanshyam31609dc2019-07-05 09:23:37 +0000203[testenv:integrated-placement]
204envdir = .tox/tempest
205sitepackages = {[tempestenv]sitepackages}
206setenv = {[tempestenv]setenv}
207deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000208regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
209regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
Ghanshyam31609dc2019-07-05 09:23:37 +0000210# The regex below is used to select which tests to run and exclude the slow tag and
Martin Kopecdc844232020-12-24 15:57:53 +0000211# tests listed in exclude-list file:
Ghanshyam31609dc2019-07-05 09:23:37 +0000212commands =
213 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000214 tempest run --regex {[testenv:integrated-placement]regex1} --exclude-list ./tools/tempest-integrated-gate-placement-exclude-list.txt {posargs}
215 tempest run --combine --serial --regex {[testenv:integrated-placement]regex2} --exclude-list ./tools/tempest-integrated-gate-placement-exclude-list.txt {posargs}
Ghanshyam31609dc2019-07-05 09:23:37 +0000216
Ghanshyam Manna6994452019-07-05 08:43:23 +0000217[testenv:integrated-storage]
218envdir = .tox/tempest
219sitepackages = {[tempestenv]sitepackages}
220setenv = {[tempestenv]setenv}
221deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000222regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
223regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
Ghanshyam Manna6994452019-07-05 08:43:23 +0000224# The regex below is used to select which tests to run and exclude the slow tag and
Martin Kopecdc844232020-12-24 15:57:53 +0000225# tests listed in exclude-list file:
Ghanshyam Manna6994452019-07-05 08:43:23 +0000226commands =
227 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000228 tempest run --regex {[testenv:integrated-storage]regex1} --exclude-list ./tools/tempest-integrated-gate-storage-exclude-list.txt {posargs}
229 tempest run --combine --serial --regex {[testenv:integrated-storage]regex2} --exclude-list ./tools/tempest-integrated-gate-storage-exclude-list.txt {posargs}
Ghanshyam Manna6994452019-07-05 08:43:23 +0000230
Ghanshyam95358522019-07-05 08:58:32 +0000231[testenv:integrated-object-storage]
232envdir = .tox/tempest
233sitepackages = {[tempestenv]sitepackages}
234setenv = {[tempestenv]setenv}
235deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000236regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
237regex2 = '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
Ghanshyam95358522019-07-05 08:58:32 +0000238# The regex below is used to select which tests to run and exclude the slow tag and
Martin Kopecdc844232020-12-24 15:57:53 +0000239# tests listed in exclude-list file:
Ghanshyam95358522019-07-05 08:58:32 +0000240commands =
241 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000242 tempest run --regex {[testenv:integrated-object-storage]regex1} --exclude-list ./tools/tempest-integrated-gate-object-storage-exclude-list.txt {posargs}
243 tempest run --combine --serial --regex {[testenv:integrated-object-storage]regex2} --exclude-list ./tools/tempest-integrated-gate-object-storage-exclude-list.txt {posargs}
Ghanshyam95358522019-07-05 08:58:32 +0000244
Matthew Treinish99288cd2014-02-10 09:21:51 -0500245[testenv:full-serial]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400246envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400247sitepackages = {[tempestenv]sitepackages}
248setenv = {[tempestenv]setenv}
249deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000250regex = '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|serial_tests))'
Matthew Treinish99288cd2014-02-10 09:21:51 -0500251# The regex below is used to select which tests to run and exclude the slow tag:
Masayuki Igawa83522042015-12-01 16:51:34 +0900252# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
Martin Kopecdc844232020-12-24 15:57:53 +0000253# FIXME: We can replace it with the `--exclude-regex` option to exclude tests now.
Matthew Treinish99288cd2014-02-10 09:21:51 -0500254commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900255 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000256 tempest run --serial --regex {[testenv:full-serial]regex} {posargs}
Matthew Treinish99288cd2014-02-10 09:21:51 -0500257
Andrea Frittolib838af92017-03-06 15:11:13 +0000258[testenv:scenario]
259envdir = .tox/tempest
260sitepackages = {[tempestenv]sitepackages}
261setenv = {[tempestenv]setenv}
262deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000263regex = '(^tempest\.scenario)'
Andrea Frittolib838af92017-03-06 15:11:13 +0000264# The regex below is used to select all scenario tests
265commands =
266 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000267 tempest run --serial --regex {[testenv:scenario]regex} {posargs}
Andrea Frittolib838af92017-03-06 15:11:13 +0000268
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400269[testenv:smoke]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400270envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400271sitepackages = {[tempestenv]sitepackages}
272setenv = {[tempestenv]setenv}
273deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000274regex = '\[.*\bsmoke\b.*\]'
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400275commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900276 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000277 tempest run --regex {[testenv:smoke]regex} {posargs}
Monty Taylor8d4c90c2013-05-02 14:33:18 -0400278
Joe Gordond2796292013-11-14 12:55:55 -0800279[testenv:smoke-serial]
Matthew Treinish0e25a902016-04-29 16:38:51 -0400280envdir = .tox/tempest
Matthew Treinish5b7626a2014-09-23 17:39:38 -0400281sitepackages = {[tempestenv]sitepackages}
282setenv = {[tempestenv]setenv}
283deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000284regex = '\[.*\bsmoke\b.*\]'
Joe Gordond2796292013-11-14 12:55:55 -0800285# This is still serial because neutron doesn't work with parallel. See:
286# https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
287# job would fail if we moved it to parallel.
288commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900289 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000290 tempest run --serial --regex {[testenv:smoke-serial]regex} {posargs}
Joe Gordond2796292013-11-14 12:55:55 -0800291
ghanshyam10326c72018-08-01 08:53:00 +0000292[testenv:slow-serial]
293envdir = .tox/tempest
294sitepackages = {[tempestenv]sitepackages}
295setenv = {[tempestenv]setenv}
296deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000297regex = '\[.*\bslow\b.*\]'
ghanshyam10326c72018-08-01 08:53:00 +0000298# The regex below is used to select the slow tagged tests to run serially:
299commands =
300 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000301 tempest run --serial --regex {[testenv:slow-serial]regex} {posargs}
ghanshyam10326c72018-08-01 08:53:00 +0000302
Ghanshyam Mann6bb98c22023-02-10 18:22:02 -0600303[testenv:slow]
304envdir = .tox/tempest
305sitepackages = {[tempestenv]sitepackages}
Ghanshyam Mann6bb98c22023-02-10 18:22:02 -0600306setenv = {[tempestenv]setenv}
307deps = {[tempestenv]deps}
308# The regex below is used to select the slow tagged tests:
yatinb70d30d2023-07-27 04:29:51 +0000309regex = '\[.*\bslow\b.*\]'
Ghanshyam Mann6bb98c22023-02-10 18:22:02 -0600310commands =
311 find . -type f -name "*.pyc" -delete
yatinb70d30d2023-07-27 04:29:51 +0000312 tempest run --regex {[testenv:slow]regex} {posargs}
Ghanshyam Mann6bb98c22023-02-10 18:22:02 -0600313
Ghanshyam Manne2183ca2023-02-10 19:31:52 -0600314[testenv:multinode]
315envdir = .tox/tempest
316sitepackages = {[tempestenv]sitepackages}
Ghanshyam Manne2183ca2023-02-10 19:31:52 -0600317setenv = {[tempestenv]setenv}
318deps = {[tempestenv]deps}
319# The regex below is used to select the multinode and smoke tagged tests
320regex = '\[.*\bsmoke|multinode\b.*\]'
321commands =
322 find . -type f -name "*.pyc" -delete
323 tempest run --regex {[testenv:multinode]regex} {posargs}
324
Ghanshyama0b8ca42019-07-17 09:46:41 +0000325[testenv:ipv6-only]
326envdir = .tox/tempest
327sitepackages = {[tempestenv]sitepackages}
328setenv = {[tempestenv]setenv}
329deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000330regex = '\[.*\bsmoke|ipv6|test_network_v6\b.*\]'
Ghanshyama0b8ca42019-07-17 09:46:41 +0000331# Run only smoke and ipv6 tests. This env is used to tests
332# the ipv6 deployments and basic tests run fine so that we can
333# verify that services listen on IPv6 address.
334commands =
335 find . -type f -name "*.pyc" -delete
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000336 tempest run --regex {[testenv:ipv6-only]regex} {posargs}
Ghanshyama0b8ca42019-07-17 09:46:41 +0000337
Sean Dagueb56052b2013-05-21 17:57:41 -0400338[testenv:venv]
Matt Riedemannd5e92822018-01-25 11:25:57 -0500339deps =
Ghanshyam Mann6a122ea2023-09-26 18:53:17 -0700340 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Matt Riedemannd5e92822018-01-25 11:25:57 -0500341 -r{toxinidir}/requirements.txt
342 -r{toxinidir}/doc/requirements.txt
Sean Dagueb56052b2013-05-21 17:57:41 -0400343commands = {posargs}
Sean Dagueb56052b2013-05-21 17:57:41 -0400344
Matthew Treinish0e25a902016-04-29 16:38:51 -0400345[testenv:venv-tempest]
346envdir = .tox/tempest
347sitepackages = {[tempestenv]sitepackages}
348setenv = {[tempestenv]setenv}
349deps = {[tempestenv]deps}
350commands = {posargs}
351
Matthew Treinish8bd013e2014-06-18 21:58:32 -0400352[testenv:docs]
junboli173b11c2018-01-15 11:25:35 +0800353deps =
Ghanshyam Mann6a122ea2023-09-26 18:53:17 -0700354 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
junboli173b11c2018-01-15 11:25:35 +0800355 -r{toxinidir}/doc/requirements.txt
Mathew Oddenb389faa2015-07-30 20:24:08 +0000356commands =
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200357 sphinx-apidoc -f -o doc/source/tests/compute tempest/api/compute
358 sphinx-apidoc -f -o doc/source/tests/identity tempest/api/identity
359 sphinx-apidoc -f -o doc/source/tests/image tempest/api/image
360 sphinx-apidoc -f -o doc/source/tests/network tempest/api/network
361 sphinx-apidoc -f -o doc/source/tests/object_storage tempest/api/object_storage
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200362 sphinx-apidoc -f -o doc/source/tests/volume tempest/api/volume
Martin Kopecd76178e2024-01-16 20:43:56 +0100363 sphinx-apidoc -f -o doc/source/tests/scenario tempest/scenario
364 sphinx-apidoc -f -o doc/source/tests/serial_tests tempest/serial_tests
junboli173b11c2018-01-15 11:25:35 +0800365 rm -rf doc/build
Ihar Hrachyshka8032b2e2017-11-27 14:16:59 -0800366 sphinx-build -W -b html doc/source doc/build/html
Martin Kopecdc844232020-12-24 15:57:53 +0000367allowlist_externals =
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200368 rm
Matthew Treinish8bd013e2014-06-18 21:58:32 -0400369
Masayuki Igawa7e4ef4c2019-07-03 17:17:44 +0900370[testenv:pdf-docs]
Masayuki Igawa7e4ef4c2019-07-03 17:17:44 +0900371deps = {[testenv:docs]deps}
Martin Kopecdc844232020-12-24 15:57:53 +0000372allowlist_externals =
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200373 rm
Masayuki Igawa7e4ef4c2019-07-03 17:17:44 +0900374 make
375commands =
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200376 sphinx-apidoc -f -o doc/source/tests/compute tempest/api/compute
377 sphinx-apidoc -f -o doc/source/tests/identity tempest/api/identity
378 sphinx-apidoc -f -o doc/source/tests/image tempest/api/image
379 sphinx-apidoc -f -o doc/source/tests/network tempest/api/network
380 sphinx-apidoc -f -o doc/source/tests/object_storage tempest/api/object_storage
Lukas Piwowarskia9055012020-06-15 17:16:15 +0200381 sphinx-apidoc -f -o doc/source/tests/volume tempest/api/volume
Martin Kopecd76178e2024-01-16 20:43:56 +0100382 sphinx-apidoc -f -o doc/source/tests/scenario tempest/scenario
383 sphinx-apidoc -f -o doc/source/tests/serial_tests tempest/serial_tests
Masayuki Igawa7e4ef4c2019-07-03 17:17:44 +0900384 sphinx-build -W -b latex doc/source doc/build/pdf
385 make -C doc/build/pdf
386
Jay Pipesa6aa5f22012-07-24 19:40:29 -0400387[testenv:pep8]
afazekas40fcb9b2019-03-08 11:25:11 +0100388deps =
Pavlo Shchelokovskyy53885e52023-09-18 09:27:21 +0000389 {[testenv]deps}
afazekas40fcb9b2019-03-08 11:25:11 +0100390 autopep8
Matthew Treinish3d468112013-10-24 21:49:14 +0000391commands =
afazekas40fcb9b2019-03-08 11:25:11 +0100392 autopep8 --exit-code --max-line-length=79 --experimental --diff -r tempest setup.py
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900393 flake8 {posargs}
394 check-uuid
Matthew Treinish3d468112013-10-24 21:49:14 +0000395
afazekas40fcb9b2019-03-08 11:25:11 +0100396[testenv:autopep8]
397deps = autopep8
afazekas40fcb9b2019-03-08 11:25:11 +0100398commands =
Attila Fazekasc07edb52019-03-17 15:38:03 +0100399 {toxinidir}/tools/format.sh
afazekas40fcb9b2019-03-08 11:25:11 +0100400
Chris Hoge7579c1a2015-02-26 14:12:15 -0800401[testenv:uuidgen]
402commands =
Masayuki Igawad81d3ce2016-04-20 15:00:54 +0900403 check-uuid --fix
Chris Hoge296558c2015-02-19 00:29:49 -0600404
Giampaolo Lauria1b837ce2013-05-01 11:22:07 -0400405[hacking]
Matthew Treinish2b6db0c2014-05-17 10:42:36 -0400406import_exceptions = tempest.services
Giampaolo Lauria1b837ce2013-05-01 11:22:07 -0400407
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700408[flake8]
caoyuan349ba752019-04-23 19:40:06 +0800409# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.opendev.org/#/c/36788/
Matthew Treinish96e9e882014-06-09 18:37:19 -0400410# E123 skipped because it is ignored by default in the default pep8
Matthew Treinish1d14c542014-06-17 20:25:40 -0400411# E129 skipped because it is too limiting when combined with other rules
Stephen Finucanefc42cc62018-07-06 13:39:55 +0100412# W504 skipped because it is overeager and unnecessary
Artom Lifshitz7bd4c3a2021-10-14 10:42:41 -0400413# H405 skipped because it arbitrarily forces doctring "title" lines
414ignore = E125,E123,E129,W504,H405
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700415show-source = True
junboli8bd00e32017-08-22 17:06:15 +0800416exclude = .git,.venv,.tox,dist,doc,*egg,build
Jordan Pittier525ec712016-12-07 17:51:26 +0100417enable-extensions = H106,H203,H904
Masayuki Igawa134d9f72017-02-10 18:05:26 +0900418import-order-style = pep8
Andrea Frittoli (andreaf)897ecfb2016-02-23 10:12:48 -0500419
Andreas Jaegerf27a3342020-03-29 10:21:39 +0200420[flake8:local-plugins]
421extension =
422 T102 = checks:import_no_clients_in_api_and_scenario_tests
423 T104 = checks:scenario_tests_need_service_tags
424 T105 = checks:no_setup_teardown_class_for_tests
425 T107 = checks:service_tags_not_in_module_path
426 T108 = checks:no_hyphen_at_end_of_rand_name
427 N322 = checks:no_mutable_default_args
428 T109 = checks:no_testtools_skip_decorator
429 T110 = checks:get_resources_on_service_clients
430 T111 = checks:delete_resources_on_service_clients
431 T112 = checks:dont_import_local_tempest_into_lib
432 T113 = checks:use_rand_uuid_instead_of_uuid4
433 T114 = checks:dont_use_config_in_tempest_lib
434 T115 = checks:dont_put_admin_tests_on_nonadmin_path
435 T116 = checks:unsupported_exception_attribute_PY3
436 T117 = checks:negative_test_attribute_always_applied_to_negative_tests
Takashi Kajinami2a5ef1b2021-11-29 15:48:25 +0900437 T118 = checks:no_log_warn
Andreas Jaegerf27a3342020-03-29 10:21:39 +0200438paths =
439 ./tempest/hacking
440
Andrea Frittoli (andreaf)897ecfb2016-02-23 10:12:48 -0500441[testenv:releasenotes]
junboli173b11c2018-01-15 11:25:35 +0800442deps =
Ghanshyam Mann6a122ea2023-09-26 18:53:17 -0700443 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
junboli173b11c2018-01-15 11:25:35 +0800444 -r{toxinidir}/doc/requirements.txt
junboli8bd00e32017-08-22 17:06:15 +0800445commands =
junboli173b11c2018-01-15 11:25:35 +0800446 rm -rf releasenotes/build
447 sphinx-build -a -E -W -d releasenotes/build/doctrees \
448 -b html releasenotes/source releasenotes/build/html
Martin Kopecdc844232020-12-24 15:57:53 +0000449allowlist_externals = rm
Jordan Pittiercefaa2b2016-07-22 13:04:26 +0200450
Masayuki Igawade1153b2019-07-30 18:02:07 +0900451[testenv:bashate]
Masayuki Igawade1153b2019-07-30 18:02:07 +0900452# if you want to test out some changes you have made to bashate
453# against tempest, just set BASHATE_INSTALL_PATH=/path/... to your
454# modified bashate tree
455deps =
456 {env:BASHATE_INSTALL_PATH:bashate}
Martin Kopecdc844232020-12-24 15:57:53 +0000457allowlist_externals = bash
Masayuki Igawade1153b2019-07-30 18:02:07 +0900458commands = bash -c "find {toxinidir}/tools \
459 -not \( -type d -name .?\* -prune \) \
460 -type f \
461 -name \*.sh \
Masayuki Igawafdd96442019-08-02 13:44:49 +0900462 -print0 | xargs -0 bashate -v -eE005,E042 -i E006"
Masayuki Igawade1153b2019-07-30 18:02:07 +0900463
Jordan Pittiercefaa2b2016-07-22 13:04:26 +0200464[testenv:pip-check-reqs]
465# Do not install test-requirements as that will pollute the virtualenv for
466# determining missing packages.
467# This also means that pip-check-reqs must be installed separately, outside
468# of the requirements.txt files
469deps = pip_check_reqs
470 -r{toxinidir}/requirements.txt
471commands=
472 pip-extra-reqs -d --ignore-file=tempest/tests/* tempest
473 pip-missing-reqs -d --ignore-file=tempest/tests/* tempest
Chandan Kumarac5c5532016-11-30 18:49:26 +0530474
475
476[testenv:bindep]
477# Do not install any requirements. We want this to be fast and work even if
478# system dependencies are missing, since it's used to tell you what system
479# dependencies are missing! This also means that bindep must be installed
480# separately, outside of the requirements files.
481deps = bindep
482commands = bindep test
Chandan Kumarb7affe42017-06-29 13:57:01 +0530483
484[testenv:plugin-sanity-check]
485# perform tempest plugin sanity
Martin Kopecdc844232020-12-24 15:57:53 +0000486allowlist_externals = bash
Chandan Kumarb7affe42017-06-29 13:57:01 +0530487commands =
488 bash tools/tempest-plugin-sanity.sh
Ghanshyam Mann83d13e52020-12-29 13:13:40 -0600489
490[testenv:stestr-master]
491envdir = .tox/tempest
492sitepackages = {[tempestenv]sitepackages}
Ghanshyam Mann83d13e52020-12-29 13:13:40 -0600493setenv = {[tempestenv]setenv}
494deps = {[tempestenv]deps}
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000495regex = '\[.*\bsmoke\b.*\]'
Ghanshyam Mann83d13e52020-12-29 13:13:40 -0600496# The below command install stestr master version and run smoke tests
497commands =
498 find . -type f -name "*.pyc" -delete
499 pip install -U git+https://github.com/mtreinish/stestr
Lukas Piwowarskif0473612023-01-20 10:01:19 +0000500 tempest run --regex {[testenv:stestr-master]regex} {posargs}