Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 1 | [tox] |
| 2 | minversion = 2.0 |
Carlos Goncalves | 436dd9f | 2019-02-12 22:08:00 +0100 | [diff] [blame] | 3 | envlist = pep8 |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 4 | skipsdist = True |
| 5 | |
| 6 | [testenv] |
| 7 | usedevelop = True |
Michael Johnson | f298ed0 | 2019-06-28 16:00:38 -0700 | [diff] [blame] | 8 | install_command = pip install {opts} {packages} |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 9 | setenv = |
| 10 | VIRTUAL_ENV={envdir} |
| 11 | PYTHONWARNINGS=default::DeprecationWarning |
Michael Johnson | f298ed0 | 2019-06-28 16:00:38 -0700 | [diff] [blame] | 12 | deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
| 13 | -r{toxinidir}/test-requirements.txt |
Michael Johnson | 0f28a48 | 2018-05-23 16:22:45 -0700 | [diff] [blame] | 14 | commands = |
| 15 | stestr run {posargs} |
| 16 | stestr slowest |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 17 | |
| 18 | [testenv:pep8] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 19 | basepython = python3 |
Brian Haley | 0ae7f10 | 2020-03-20 11:14:44 -0400 | [diff] [blame] | 20 | commands = flake8 |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 21 | |
| 22 | [testenv:venv] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 23 | basepython = python3 |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 24 | commands = {posargs} |
| 25 | |
| 26 | [testenv:cover] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 27 | basepython = python3 |
Michael Johnson | 0f28a48 | 2018-05-23 16:22:45 -0700 | [diff] [blame] | 28 | setenv = |
| 29 | {[testenv]setenv} |
| 30 | PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode |
| 31 | whitelist_externals = |
| 32 | find |
| 33 | commands = |
| 34 | find octavia_tempest_plugin -type f -name "*.pyc" -delete |
| 35 | coverage erase |
| 36 | stestr run {posargs} |
| 37 | coverage combine |
| 38 | coverage html -d cover |
| 39 | coverage xml -o cover/coverage.xml |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 40 | |
| 41 | [testenv:docs] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 42 | basepython = python3 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 43 | deps = |
Michael Johnson | f298ed0 | 2019-06-28 16:00:38 -0700 | [diff] [blame] | 44 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 45 | -r{toxinidir}/requirements.txt |
Michael Johnson | a507425 | 2020-06-30 10:28:09 -0700 | [diff] [blame^] | 46 | -r{toxinidir}/test-requirements.txt |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 47 | -r{toxinidir}/doc/requirements.txt |
| 48 | whitelist_externals = rm |
| 49 | commands = |
| 50 | rm -rf doc/build |
| 51 | sphinx-build -W -b html doc/source doc/build/html |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 52 | |
Michael Johnson | 791fefb | 2019-09-13 10:48:05 -0700 | [diff] [blame] | 53 | [testenv:pdf-docs] |
| 54 | basepython = python3 |
| 55 | deps = {[testenv:docs]deps} |
| 56 | whitelist_externals = |
| 57 | make |
| 58 | rm |
| 59 | commands = |
| 60 | rm -rf doc/build/pdf |
| 61 | sphinx-build -W -b latex doc/source doc/build/pdf |
| 62 | make -C doc/build/pdf |
| 63 | |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 64 | [testenv:releasenotes] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 65 | basepython = python3 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 66 | deps = |
Michael Johnson | f298ed0 | 2019-06-28 16:00:38 -0700 | [diff] [blame] | 67 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 68 | -r{toxinidir}/requirements.txt |
| 69 | -r{toxinidir}/doc/requirements.txt |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 70 | commands = |
| 71 | sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html |
| 72 | |
| 73 | [testenv:debug] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 74 | basepython = python3 |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 75 | commands = oslo_debug_helper {posargs} |
| 76 | |
| 77 | [flake8] |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 78 | show-source = True |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 79 | builtins = _ |
| 80 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
Brian Haley | 0ae7f10 | 2020-03-20 11:14:44 -0400 | [diff] [blame] | 81 | import-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 |
| 87 | enable-extensions=H106,H203,H204,H205,H904 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 88 | |
Michael Johnson | a507425 | 2020-06-30 10:28:09 -0700 | [diff] [blame^] | 89 | [flake8:local-plugins] |
| 90 | extension = |
| 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 |
| 104 | paths = |
| 105 | ./octavia_tempest_plugin/hacking |
| 106 | |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 107 | [testenv:genconfig] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 108 | basepython = python3 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 109 | whitelist_externals = mkdir |
| 110 | commands = |
| 111 | mkdir -p etc |
| 112 | oslo-config-generator --output-file etc/octavia.tempest.conf.sample \ |
| 113 | --namespace tempest.config |