blob: c8add2c6d1b7b10221d76889f64fd14873b5c5c0 [file] [log] [blame]
Chandan Kumar5e619872017-09-07 22:23:55 +05301[tox]
wu.shimingd32821b2021-07-06 16:10:57 +08002minversion = 3.18.0
Brian Haley33ef4602018-04-26 14:37:49 -04003envlist = pep8
Ghanshyam42aac382020-02-05 15:27:04 -06004ignore_basepython_conflict = True
Chandan Kumar5e619872017-09-07 22:23:55 +05305
6[testenv]
Rodolfo Alonso Hernandezd1796842023-01-16 10:40:43 +01007basepython = {env:TOX_PYTHON:python3}
Chandan Kumar5e619872017-09-07 22:23:55 +05308usedevelop = True
Chandan Kumar5e619872017-09-07 22:23:55 +05309setenv =
10 VIRTUAL_ENV={envdir}
11 PYTHONWARNINGS=default::DeprecationWarning
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070012 OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
13 OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
14 OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
Doug Wiegley6b03ab12019-03-01 10:23:57 -070015deps =
wu.shimingd783a822020-11-17 14:04:29 +080016 -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Rodolfo Alonso Hernandezd1796842023-01-16 10:40:43 +010017 -r{toxinidir}/requirements.txt
Doug Wiegley6b03ab12019-03-01 10:23:57 -070018 -r{toxinidir}/test-requirements.txt
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070019commands = stestr run --slowest {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053020
21[testenv:pep8]
Dongcan Ye63813952017-11-18 14:22:25 +080022commands =
Rodolfo Alonso Hernandez0302a8e2022-12-24 03:52:58 +010023 bash ./tools/misc-sanity-checks.sh
Brian Haley33ef4602018-04-26 14:37:49 -040024 flake8
wu.shimingd32821b2021-07-06 16:10:57 +080025allowlist_externals =
Rodolfo Alonso Hernandez0302a8e2022-12-24 03:52:58 +010026 bash
Chandan Kumar5e619872017-09-07 22:23:55 +053027
28[testenv:venv]
29commands = {posargs}
30
31[testenv:cover]
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070032setenv =
33 {[testenv]setenv}
34 PYTHON=coverage run --source neutron_tempest_plugin --parallel-mode
35commands =
36 stestr run --no-subunit-trace {posargs}
37 coverage combine
38 coverage html -d cover
39 coverage xml -o cover/coverage.xml
Chandan Kumar5e619872017-09-07 22:23:55 +053040
41[testenv:docs]
elajkat29030402021-01-05 12:52:45 +010042deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Elod Illesf2e985e2023-11-06 19:30:29 +010043 -r{toxinidir}/requirements.txt
elajkat29030402021-01-05 12:52:45 +010044 -r{toxinidir}/doc/requirements.txt
Elod Illesf2e985e2023-11-06 19:30:29 +010045commands =
46 rm -rf doc/source/tests
47 sphinx-apidoc -f -o doc/source/tests neutron_tempest_plugin
48 rm -rf doc/build
49 sphinx-build -W -b html doc/source doc/build/html
50allowlist_externals =
51 rm
Chandan Kumar5e619872017-09-07 22:23:55 +053052
53[testenv:releasenotes]
elajkat29030402021-01-05 12:52:45 +010054deps = {[testenv:docs]deps}
Chandan Kumar5e619872017-09-07 22:23:55 +053055commands =
56 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
57
58[testenv:debug]
Manjeet Singh Bhatia3448e0b2018-02-14 10:41:11 -080059commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053060
61[flake8]
Chandan Kumar667d3d32017-09-22 12:24:06 +053062# E126 continuation line over-indented for hanging indent
63# E128 continuation line under-indented for visual indent
64# E129 visually indented line with same indent as next logical line
Takashi Kajinami435ff6f2024-11-16 15:33:27 +090065# I202 Additional newline in a group of imports.
Chandan Kumar667d3d32017-09-22 12:24:06 +053066# N530 direct neutron imports not allowed
Bernard Cafarellic3bec862020-09-10 13:59:49 +020067# W504 line break after binary operator
Takashi Kajinami435ff6f2024-11-16 15:33:27 +090068ignore = E126,E128,E129,I202,N530,W504
Chandan Kumar667d3d32017-09-22 12:24:06 +053069# H106: Don't put vim configuration in source files
70# H203: Use assertIs(Not)None to check for None
Brian Haleyd4fa6dc2019-06-27 11:31:55 -040071# H204: Use assert(Not)Equal to check for equality
72# H205: Use assert(Greater|Less)(Equal) for comparison
Chandan Kumar667d3d32017-09-22 12:24:06 +053073# H904: Delay string interpolations at logging calls
Brian Haleyd4fa6dc2019-06-27 11:31:55 -040074enable-extensions = H106,H203,H204,H205,H904
Chandan Kumar667d3d32017-09-22 12:24:06 +053075show-source = true
Brian Haley6767cec2018-04-10 15:30:23 -040076exclude = ./.*,build,dist,doc,*egg*,releasenotes
Chandan Kumar667d3d32017-09-22 12:24:06 +053077import-order-style = pep8