blob: 4f0539b327cf8349a5c9147734eaad38d627fc85 [file] [log] [blame]
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01001[tox]
wangzihao45b3d392021-05-20 14:09:51 +08002minversion = 3.18.0
dekehne32fe1a2022-01-25 16:52:33 +00003envlist = pep8
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01004skipsdist = True
Ghanshyam3862c0a2020-01-23 17:17:45 -06005ignore_basepython_conflict = True
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01006
7[testenv]
Ghanshyam3862c0a2020-01-23 17:17:45 -06008basepython = python3
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01009usedevelop = True
Andreas Jaeger7cd8d5a2017-12-02 07:11:16 +010010install_command = pip install {opts} {packages}
11deps =
wangzihao45b3d392021-05-20 14:09:51 +080012 -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Andreas Jaeger7cd8d5a2017-12-02 07:11:16 +010013 -r{toxinidir}/requirements.txt
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010014 -r{toxinidir}/test-requirements.txt
15setenv =
Tony Breedsde55ca22016-12-20 15:42:54 +110016 VIRTUAL_ENV={envdir}
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010017 PYTHONDONTWRITEBYTECODE=1
Takashi Kajinamia5ac52d2022-05-22 22:21:34 +090018allowlist_externals = sh
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010019 find
20 rm
21commands =
22 find . -type f -name "*.pyc" -delete
Vu Cong Tuanf348bfe2018-07-12 14:12:34 +070023 stestr run {posargs}
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010024passenv = http_proxy
25 HTTP_PROXY
26 https_proxy
27 HTTPS_PROXY
28 no_proxy
29 NO_PROXY
30 OS_DEBUG
31 OS_LOG_CAPTURE
32 OS_STDERR_CAPTURE
33 OS_STDOUT_CAPTURE
34
35[testenv:pep8]
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010036commands = sh tools/pretty_flake8.sh
37
Graham Hayesc392cf92017-02-23 16:06:04 -050038[testenv:docs]
Nicolas Bockadd73112021-01-04 10:24:01 -070039deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
40 -r{toxinidir}/doc/requirements.txt
Graham Hayesc392cf92017-02-23 16:06:04 -050041commands = rm -rf doc/build
42 sphinx-build -E -W -b html doc/source doc/build/html
43
Nicolas Bockadd73112021-01-04 10:24:01 -070044[testenv:releasenotes]
45deps = {[testenv:docs]deps}
Takashi Kajinamia5ac52d2022-05-22 22:21:34 +090046allowlist_externals = rm
Nicolas Bockadd73112021-01-04 10:24:01 -070047commands =
48 rm -rf releasenotes/build
49 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
50
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010051[testenv:bashate]
52deps = bashate
Takashi Kajinamia5ac52d2022-05-22 22:21:34 +090053allowlist_externals = bash
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010054commands = bash -c "find {toxinidir}/devstack \
55 -not \( -type d -name .?\* -prune \) \
56 -not \( -type d -name doc -prune \) \
57 -type f \
58 -not -name \*~ \
59 -not -name \*.md \
60 \( \
61 -name \*.sh -or \
62 -name \*rc -or \
63 -name functions\* -or \
64 -wholename \*/lib/\* \
65 \) \
66 -print0 | xargs -0 bashate -v"
67
68[testenv:pip-check-reqs]
69# do not install test-requirements as that will pollute the virtualenv for
70# determining missing packages
71# this also means that pip-missing-reqs must be installed separately, outside
72# of the requirements.txt files
73deps = pip-check-reqs
74 -r{toxinidir}/requirements.txt
75commands=pip-missing-reqs -d --ignore-file=designate/tests/* designate
76
77[testenv:venv]
78commands = {posargs}
79
80[flake8]
81# ignored flake8 codes:
82# H302 import only modules
83# H306 imports not in alphabetical order
84# H402 one line docstring needs punctuation
85# H404 multi line docstring should start with a summary
86# H405 multi line docstring summary not separated with an empty line
87# H904 Wrap long lines in parentheses instead of a backslash
88# E126 continuation line over-indented for hanging indent
89# E128 continuation line under-indented for visual indent
Andreas Jaeger5fb81fa2020-03-29 15:37:12 +020090# W504 line break after binary operator
91ignore = H302,H306,H402,H404,H405,H904,E126,E128,W504
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010092exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools,.ropeproject
Kiall Mac Innesa17f2332016-08-25 13:34:42 +010093
Andreas Jaeger5fb81fa2020-03-29 15:37:12 +020094[flake8:local-plugins]
95extension =
96 T102 = tempest.hacking.checks:import_no_clients_in_api_and_scenario_tests
97 T104 = tempest.hacking.checks:scenario_tests_need_service_tags
98 T105 = tempest.hacking.checks:no_setup_teardown_class_for_tests
99 T107 = tempest.hacking.checks:service_tags_not_in_module_path
100 T108 = tempest.hacking.checks:no_hyphen_at_end_of_rand_name
101 N322 = tempest.hacking.checks:no_mutable_default_args
102 T109 = tempest.hacking.checks:no_testtools_skip_decorator
Michael Johnson4d257b32024-11-08 20:28:36 +0000103# TODO(johnsom) Re-enable these once tempest updates hacking to > 3.1.0
104# T110 = tempest.hacking.checks:get_resources_on_service_clients
105# T111 = tempest.hacking.checks:delete_resources_on_service_clients
Andreas Jaeger5fb81fa2020-03-29 15:37:12 +0200106 T112 = tempest.hacking.checks:dont_import_local_tempest_into_lib
107 T113 = tempest.hacking.checks:dont_use_config_in_tempest_lib
108 T114 = tempest.hacking.checks:use_rand_uuid_instead_of_uuid4
Michael Johnsoncc8f89b2021-11-30 00:31:24 +0000109 D701 = checks:mutable_default_arguments
110 D703 = checks:check_explicit_underscore_import
111 D704 = checks:no_import_graduated_oslo_libraries
112 D705 = checks:use_timeutils_utcnow
113 D706 = checks:no_translate_debug_logs
114 D707 = checks:check_no_basestring
115 D708 = checks:check_python3_xrange
116 D709 = checks:check_no_log_audit
117 D710 = checks:check_no_log_warn
118 D711 = checks:check_line_continuation_no_backslash
119paths = ./designate_tempest_plugin/hacking
120