blob: 8854d214f618b6ce359bbd654e7afbf32ba7bb73 [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]
Brian Haley0ae7f102020-03-20 11:14:44 -040021commands = flake8
Michael Johnson34139b02017-03-15 10:31:10 -070022
23[testenv:venv]
24commands = {posargs}
25
26[testenv:cover]
Michael Johnson0f28a482018-05-23 16:22:45 -070027setenv =
28 {[testenv]setenv}
29 PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode
30whitelist_externals =
31 find
32commands =
33 find octavia_tempest_plugin -type f -name "*.pyc" -delete
34 coverage erase
35 stestr run {posargs}
36 coverage combine
37 coverage html -d cover
38 coverage xml -o cover/coverage.xml
Michael Johnson34139b02017-03-15 10:31:10 -070039
40[testenv:docs]
Jude Cross986e3f52017-07-24 14:57:20 -070041deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070042 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070043 -r{toxinidir}/requirements.txt
Michael Johnsona5074252020-06-30 10:28:09 -070044 -r{toxinidir}/test-requirements.txt
Jude Cross986e3f52017-07-24 14:57:20 -070045 -r{toxinidir}/doc/requirements.txt
46whitelist_externals = rm
47commands =
48 rm -rf doc/build
49 sphinx-build -W -b html doc/source doc/build/html
Michael Johnson34139b02017-03-15 10:31:10 -070050
Michael Johnson791fefb2019-09-13 10:48:05 -070051[testenv:pdf-docs]
Michael Johnson791fefb2019-09-13 10:48:05 -070052deps = {[testenv:docs]deps}
53whitelist_externals =
54 make
55 rm
56commands =
57 rm -rf doc/build/pdf
58 sphinx-build -W -b latex doc/source doc/build/pdf
59 make -C doc/build/pdf
60
Michael Johnson34139b02017-03-15 10:31:10 -070061[testenv:releasenotes]
Jude Cross986e3f52017-07-24 14:57:20 -070062deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070063 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070064 -r{toxinidir}/requirements.txt
65 -r{toxinidir}/doc/requirements.txt
Michael Johnson34139b02017-03-15 10:31:10 -070066commands =
67 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
68
69[testenv:debug]
70commands = oslo_debug_helper {posargs}
71
72[flake8]
Michael Johnson34139b02017-03-15 10:31:10 -070073show-source = True
Michael Johnson34139b02017-03-15 10:31:10 -070074builtins = _
75exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Brian Haley0ae7f102020-03-20 11:14:44 -040076import-order-style = pep8
77# [H106]: Don't put vim configuration in source files
78# [H203]: Use assertIs(Not)None to check for None
79# [H204]: Use assert(Not)Equal to check for equality
80# [H205]: Use assert(Greater|Less)(Equal) for comparison
81# [H904]: Delay string interpolations at logging calls
82enable-extensions=H106,H203,H204,H205,H904
Jude Cross986e3f52017-07-24 14:57:20 -070083
Michael Johnsona5074252020-06-30 10:28:09 -070084[flake8:local-plugins]
85extension =
86 O316 = checks:assert_true_instance
87 O318 = checks:assert_equal_or_not_none
88 O323 = checks:assert_equal_true_or_false
89 O324 = checks:no_mutable_default_args
90 O338 = checks:assert_equal_in
91 O339 = checks:no_log_warn
92 O341 = checks:no_translate_logs
93 O342 = checks:check_raised_localized_exceptions
94 O345 = checks:check_no_eventlet_imports
95 O346 = checks:check_line_continuation_no_backslash
96 O347 = checks:revert_must_have_kwargs
97 O348 = checks:check_no_logging_imports
98 O349 = checks:check_no_import_mock
99paths =
100 ./octavia_tempest_plugin/hacking
101
Jude Cross986e3f52017-07-24 14:57:20 -0700102[testenv:genconfig]
103whitelist_externals = mkdir
104commands =
105 mkdir -p etc
106 oslo-config-generator --output-file etc/octavia.tempest.conf.sample \
107 --namespace tempest.config
Brian Haley47e45892020-05-19 15:56:11 -0400108
109[testenv:requirements]
110deps =
111 -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
112whitelist_externals = sh
113commands =
114 sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'