blob: e51766f8ee82b50ad13bb484f30ba1fa68a03fd4 [file] [log] [blame]
Michael Johnson34139b02017-03-15 10:31:10 -07001[tox]
Takashi Kajinamia6ccdc92022-05-22 22:31:33 +09002minversion = 3.18.0
Carlos Goncalves436dd9f2019-02-12 22:08:00 +01003envlist = pep8
Brian Haley47e45892020-05-19 15:56:11 -04004ignore_basepython_conflict = True
Michael Johnson34139b02017-03-15 10:31:10 -07005
6[testenv]
Brian Haley47e45892020-05-19 15:56:11 -04007basepython = python3
Michael Johnson34139b02017-03-15 10:31:10 -07008usedevelop = True
Michael Johnsonf298ed02019-06-28 16:00:38 -07009install_command = pip install {opts} {packages}
Michael Johnson34139b02017-03-15 10:31:10 -070010setenv =
11 VIRTUAL_ENV={envdir}
12 PYTHONWARNINGS=default::DeprecationWarning
LiZekuneaee4b82022-06-05 11:04:53 +080013deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Michael Johnsonf298ed02019-06-28 16:00:38 -070014 -r{toxinidir}/test-requirements.txt
Michael Johnson0f28a482018-05-23 16:22:45 -070015commands =
16 stestr run {posargs}
17 stestr slowest
Michael Johnson34139b02017-03-15 10:31:10 -070018
19[testenv:pep8]
Michael Johnson46658f22020-09-13 10:38:35 -070020commands =
21 flake8
22 check-uuid --package octavia_tempest_plugin
23
24[testenv:uuidgen]
25commands = check-uuid --fix --package octavia_tempest_plugin
Michael Johnson34139b02017-03-15 10:31:10 -070026
27[testenv:venv]
28commands = {posargs}
29
Michael Johnson34139b02017-03-15 10:31:10 -070030[testenv:docs]
Jude Cross986e3f52017-07-24 14:57:20 -070031deps =
LiZekuneaee4b82022-06-05 11:04:53 +080032 -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
33 -r{toxinidir}/requirements.txt
Michael Johnsona5074252020-06-30 10:28:09 -070034 -r{toxinidir}/test-requirements.txt
Jude Cross986e3f52017-07-24 14:57:20 -070035 -r{toxinidir}/doc/requirements.txt
Takashi Kajinamia6ccdc92022-05-22 22:31:33 +090036allowlist_externals = rm
Jude Cross986e3f52017-07-24 14:57:20 -070037commands =
38 rm -rf doc/build
39 sphinx-build -W -b html doc/source doc/build/html
Michael Johnson34139b02017-03-15 10:31:10 -070040
Michael Johnson791fefb2019-09-13 10:48:05 -070041[testenv:pdf-docs]
Michael Johnson791fefb2019-09-13 10:48:05 -070042deps = {[testenv:docs]deps}
Takashi Kajinamia6ccdc92022-05-22 22:31:33 +090043allowlist_externals =
Michael Johnson791fefb2019-09-13 10:48:05 -070044 make
45 rm
46commands =
47 rm -rf doc/build/pdf
48 sphinx-build -W -b latex doc/source doc/build/pdf
49 make -C doc/build/pdf
50
Michael Johnson34139b02017-03-15 10:31:10 -070051[testenv:releasenotes]
Jude Cross986e3f52017-07-24 14:57:20 -070052deps =
LiZekuneaee4b82022-06-05 11:04:53 +080053 -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070054 -r{toxinidir}/requirements.txt
55 -r{toxinidir}/doc/requirements.txt
Michael Johnson34139b02017-03-15 10:31:10 -070056commands =
57 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
58
59[testenv:debug]
60commands = oslo_debug_helper {posargs}
61
62[flake8]
Michael Johnson34139b02017-03-15 10:31:10 -070063show-source = True
Michael Johnson34139b02017-03-15 10:31:10 -070064builtins = _
65exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Brian Haley0ae7f102020-03-20 11:14:44 -040066import-order-style = pep8
67# [H106]: Don't put vim configuration in source files
68# [H203]: Use assertIs(Not)None to check for None
69# [H204]: Use assert(Not)Equal to check for equality
70# [H205]: Use assert(Greater|Less)(Equal) for comparison
71# [H904]: Delay string interpolations at logging calls
72enable-extensions=H106,H203,H204,H205,H904
Jude Cross986e3f52017-07-24 14:57:20 -070073
Michael Johnsona5074252020-06-30 10:28:09 -070074[flake8:local-plugins]
75extension =
76 O316 = checks:assert_true_instance
77 O318 = checks:assert_equal_or_not_none
78 O323 = checks:assert_equal_true_or_false
79 O324 = checks:no_mutable_default_args
80 O338 = checks:assert_equal_in
81 O339 = checks:no_log_warn
82 O341 = checks:no_translate_logs
83 O342 = checks:check_raised_localized_exceptions
84 O345 = checks:check_no_eventlet_imports
85 O346 = checks:check_line_continuation_no_backslash
86 O347 = checks:revert_must_have_kwargs
87 O348 = checks:check_no_logging_imports
Michael Johnsona5074252020-06-30 10:28:09 -070088paths =
89 ./octavia_tempest_plugin/hacking
90
Jude Cross986e3f52017-07-24 14:57:20 -070091[testenv:genconfig]
Takashi Kajinamia6ccdc92022-05-22 22:31:33 +090092allowlist_externals = mkdir
Jude Cross986e3f52017-07-24 14:57:20 -070093commands =
94 mkdir -p etc
95 oslo-config-generator --output-file etc/octavia.tempest.conf.sample \
96 --namespace tempest.config
Brian Haley47e45892020-05-19 15:56:11 -040097
98[testenv:requirements]
99deps =
100 -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
Takashi Kajinamia6ccdc92022-05-22 22:31:33 +0900101allowlist_externals = sh
Brian Haley47e45892020-05-19 15:56:11 -0400102commands =
103 sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'