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 |
| 46 | -r{toxinidir}/doc/requirements.txt |
| 47 | whitelist_externals = rm |
| 48 | commands = |
| 49 | rm -rf doc/build |
| 50 | sphinx-build -W -b html doc/source doc/build/html |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 51 | |
Michael Johnson | 791fefb | 2019-09-13 10:48:05 -0700 | [diff] [blame] | 52 | [testenv:pdf-docs] |
| 53 | basepython = python3 |
| 54 | deps = {[testenv:docs]deps} |
| 55 | whitelist_externals = |
| 56 | make |
| 57 | rm |
| 58 | commands = |
| 59 | rm -rf doc/build/pdf |
| 60 | sphinx-build -W -b latex doc/source doc/build/pdf |
| 61 | make -C doc/build/pdf |
| 62 | |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 63 | [testenv:releasenotes] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 64 | basepython = python3 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 65 | deps = |
Michael Johnson | f298ed0 | 2019-06-28 16:00:38 -0700 | [diff] [blame] | 66 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 67 | -r{toxinidir}/requirements.txt |
| 68 | -r{toxinidir}/doc/requirements.txt |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 69 | commands = |
| 70 | sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html |
| 71 | |
| 72 | [testenv:debug] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 73 | basepython = python3 |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 74 | commands = oslo_debug_helper {posargs} |
| 75 | |
| 76 | [flake8] |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 77 | show-source = True |
Michael Johnson | 34139b0 | 2017-03-15 10:31:10 -0700 | [diff] [blame] | 78 | builtins = _ |
| 79 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
Brian Haley | 0ae7f10 | 2020-03-20 11:14:44 -0400 | [diff] [blame] | 80 | import-order-style = pep8 |
| 81 | # [H106]: Don't put vim configuration in source files |
| 82 | # [H203]: Use assertIs(Not)None to check for None |
| 83 | # [H204]: Use assert(Not)Equal to check for equality |
| 84 | # [H205]: Use assert(Greater|Less)(Equal) for comparison |
| 85 | # [H904]: Delay string interpolations at logging calls |
| 86 | enable-extensions=H106,H203,H204,H205,H904 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 87 | |
| 88 | [testenv:genconfig] |
huang.zhiping | ce50c73 | 2018-06-09 18:52:30 +0800 | [diff] [blame] | 89 | basepython = python3 |
Jude Cross | 986e3f5 | 2017-07-24 14:57:20 -0700 | [diff] [blame] | 90 | whitelist_externals = mkdir |
| 91 | commands = |
| 92 | mkdir -p etc |
| 93 | oslo-config-generator --output-file etc/octavia.tempest.conf.sample \ |
| 94 | --namespace tempest.config |