blob: 86d81b127e26c2c2620ccbcf3ec4a1db66d976f0 [file] [log] [blame]
Michael Johnson34139b02017-03-15 10:31:10 -07001[tox]
Brian Haley47e45892020-05-19 15:56:11 -04002minversion = 3.1
Carlos Goncalves436dd9f2019-02-12 22:08:00 +01003envlist = pep8
Michael Johnson34139b02017-03-15 10:31:10 -07004skipsdist = True
Brian Haley47e45892020-05-19 15:56:11 -04005ignore_basepython_conflict = True
Michael Johnson34139b02017-03-15 10:31:10 -07006
7[testenv]
Brian Haley47e45892020-05-19 15:56:11 -04008basepython = python3
Michael Johnson34139b02017-03-15 10:31:10 -07009usedevelop = True
Michael Johnsonf298ed02019-06-28 16:00:38 -070010install_command = pip install {opts} {packages}
Michael Johnson34139b02017-03-15 10:31:10 -070011setenv =
12 VIRTUAL_ENV={envdir}
13 PYTHONWARNINGS=default::DeprecationWarning
Michael Johnsonf298ed02019-06-28 16:00:38 -070014deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
15 -r{toxinidir}/test-requirements.txt
Michael Johnson0f28a482018-05-23 16:22:45 -070016commands =
17 stestr run {posargs}
18 stestr slowest
Michael Johnson34139b02017-03-15 10:31:10 -070019
20[testenv:pep8]
Michael Johnson46658f22020-09-13 10:38:35 -070021commands =
22 flake8
23 check-uuid --package octavia_tempest_plugin
24
25[testenv:uuidgen]
26commands = check-uuid --fix --package octavia_tempest_plugin
Michael Johnson34139b02017-03-15 10:31:10 -070027
28[testenv:venv]
29commands = {posargs}
30
31[testenv:cover]
Michael Johnson0f28a482018-05-23 16:22:45 -070032setenv =
33 {[testenv]setenv}
34 PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode
35whitelist_externals =
36 find
37commands =
38 find octavia_tempest_plugin -type f -name "*.pyc" -delete
39 coverage erase
40 stestr run {posargs}
41 coverage combine
42 coverage html -d cover
43 coverage xml -o cover/coverage.xml
Michael Johnson34139b02017-03-15 10:31:10 -070044
45[testenv:docs]
Jude Cross986e3f52017-07-24 14:57:20 -070046deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070047 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070048 -r{toxinidir}/requirements.txt
Michael Johnsona5074252020-06-30 10:28:09 -070049 -r{toxinidir}/test-requirements.txt
Jude Cross986e3f52017-07-24 14:57:20 -070050 -r{toxinidir}/doc/requirements.txt
51whitelist_externals = rm
52commands =
53 rm -rf doc/build
54 sphinx-build -W -b html doc/source doc/build/html
Michael Johnson34139b02017-03-15 10:31:10 -070055
Michael Johnson791fefb2019-09-13 10:48:05 -070056[testenv:pdf-docs]
Michael Johnson791fefb2019-09-13 10:48:05 -070057deps = {[testenv:docs]deps}
58whitelist_externals =
59 make
60 rm
61commands =
62 rm -rf doc/build/pdf
63 sphinx-build -W -b latex doc/source doc/build/pdf
64 make -C doc/build/pdf
65
Michael Johnson34139b02017-03-15 10:31:10 -070066[testenv:releasenotes]
Jude Cross986e3f52017-07-24 14:57:20 -070067deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070068 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070069 -r{toxinidir}/requirements.txt
70 -r{toxinidir}/doc/requirements.txt
Michael Johnson34139b02017-03-15 10:31:10 -070071commands =
72 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
73
74[testenv:debug]
75commands = oslo_debug_helper {posargs}
76
77[flake8]
Michael Johnson34139b02017-03-15 10:31:10 -070078show-source = True
Michael Johnson34139b02017-03-15 10:31:10 -070079builtins = _
80exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Brian Haley0ae7f102020-03-20 11:14:44 -040081import-order-style = pep8
82# [H106]: Don't put vim configuration in source files
83# [H203]: Use assertIs(Not)None to check for None
84# [H204]: Use assert(Not)Equal to check for equality
85# [H205]: Use assert(Greater|Less)(Equal) for comparison
86# [H904]: Delay string interpolations at logging calls
87enable-extensions=H106,H203,H204,H205,H904
Jude Cross986e3f52017-07-24 14:57:20 -070088
Michael Johnsona5074252020-06-30 10:28:09 -070089[flake8:local-plugins]
90extension =
91 O316 = checks:assert_true_instance
92 O318 = checks:assert_equal_or_not_none
93 O323 = checks:assert_equal_true_or_false
94 O324 = checks:no_mutable_default_args
95 O338 = checks:assert_equal_in
96 O339 = checks:no_log_warn
97 O341 = checks:no_translate_logs
98 O342 = checks:check_raised_localized_exceptions
99 O345 = checks:check_no_eventlet_imports
100 O346 = checks:check_line_continuation_no_backslash
101 O347 = checks:revert_must_have_kwargs
102 O348 = checks:check_no_logging_imports
103 O349 = checks:check_no_import_mock
104paths =
105 ./octavia_tempest_plugin/hacking
106
Jude Cross986e3f52017-07-24 14:57:20 -0700107[testenv:genconfig]
108whitelist_externals = mkdir
109commands =
110 mkdir -p etc
111 oslo-config-generator --output-file etc/octavia.tempest.conf.sample \
112 --namespace tempest.config
Brian Haley47e45892020-05-19 15:56:11 -0400113
114[testenv:requirements]
115deps =
116 -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
117whitelist_externals = sh
118commands =
119 sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'