DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 1 | [tox] |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 2 | minversion = 1.6 |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 3 | envlist = pep8,py35,py27 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 4 | skipsdist = True |
| 5 | |
| 6 | [testenv] |
| 7 | usedevelop = True |
| 8 | install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} |
| 9 | setenv = |
| 10 | VIRTUAL_ENV={envdir} |
Felipe Monteiro | 7de1905 | 2017-08-06 05:47:27 +0100 | [diff] [blame] | 11 | OS_TEST_PATH=./patrole_tempest_plugin/tests/unit |
| 12 | LANGUAGE=en_US |
| 13 | LC_ALL=en_US.utf-8 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 14 | PYTHONWARNINGS=default::DeprecationWarning |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 15 | passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 16 | whitelist_externals = find |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 17 | deps = -r{toxinidir}/requirements.txt |
| 18 | -r{toxinidir}/test-requirements.txt |
Jeremy Liu | e1014be | 2017-03-22 18:33:00 -0700 | [diff] [blame] | 19 | commands = |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 20 | find . -type f -name "*.pyc" -delete |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 21 | stestr --test-path ./patrole_tempest_plugin/tests/unit run {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 22 | |
| 23 | [testenv:pep8] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 24 | basepython = python3 |
Gage Hugo | 0f73e7c | 2018-08-21 15:51:08 -0500 | [diff] [blame^] | 25 | deps = |
| 26 | -r{toxinidir}/test-requirements.txt |
| 27 | commands = |
| 28 | flake8 {posargs} |
| 29 | bandit -r patrole_tempest_plugin -x patrole_tempest_plugin/tests -n 5 |
| 30 | check-uuid --package patrole_tempest_plugin.tests.api |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 31 | |
| 32 | [testenv:uuidgen] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 33 | basepython = python3 |
Jeremy Liu | 78b1925 | 2017-04-01 16:19:09 +0800 | [diff] [blame] | 34 | commands = check-uuid --package patrole_tempest_plugin.tests.api --fix |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 35 | |
| 36 | [testenv:venv] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 37 | basepython = python3 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 38 | commands = {posargs} |
| 39 | |
| 40 | [testenv:cover] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 41 | basepython = python3 |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 42 | commands = rm -rf *.pyc |
| 43 | rm -rf cover |
| 44 | rm -f .coverage |
| 45 | nosetests {posargs} |
Felipe Monteiro | 1ee5f4d | 2017-03-04 18:07:27 +0000 | [diff] [blame] | 46 | setenv = VIRTUAL_ENV={envdir} |
| 47 | NOSE_WITH_COVERAGE=1 |
| 48 | NOSE_COVER_BRANCHES=1 |
| 49 | NOSE_COVER_PACKAGE=patrole_tempest_plugin |
| 50 | NOSE_COVER_HTML=1 |
| 51 | NOSE_COVER_HTML_DIR={toxinidir}/cover |
| 52 | NOSE_WHERE=patrole_tempest_plugin/tests/unit |
| 53 | whitelist_externals = nosetests |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 54 | rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 55 | |
| 56 | [testenv:docs] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 57 | basepython = python3 |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 58 | deps = |
| 59 | -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} |
| 60 | -r{toxinidir}/requirements.txt |
| 61 | -r{toxinidir}/doc/requirements.txt |
| 62 | commands = |
| 63 | rm -rf doc/build |
| 64 | sphinx-build -W -b html doc/source doc/build/html |
| 65 | whitelist_externals = rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 66 | |
| 67 | [testenv:releasenotes] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 68 | basepython = python3 |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 69 | deps = |
| 70 | -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} |
| 71 | -r{toxinidir}/requirements.txt |
| 72 | -r{toxinidir}/doc/requirements.txt |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 73 | commands = |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 74 | rm -rf releasenotes/build |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 75 | sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 76 | whitelist_externals = rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 77 | |
| 78 | [testenv:debug] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 79 | basepython = python3 |
HaiJieZhang | ae9db6f | 2017-03-23 11:28:16 +0800 | [diff] [blame] | 80 | commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 81 | |
Felipe Monteiro | 098a8cd | 2017-09-20 21:31:27 +0100 | [diff] [blame] | 82 | [testenv:genconfig] |
huang.zhiping | 68f4c2f | 2018-06-09 20:26:49 +0800 | [diff] [blame] | 83 | basepython = python3 |
Felipe Monteiro | 098a8cd | 2017-09-20 21:31:27 +0100 | [diff] [blame] | 84 | commands = oslo-config-generator --config-file etc/config-generator.patrole.conf |
| 85 | |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 86 | [flake8] |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame] | 87 | # [H106] Don't put vim configuration in source files. |
Felipe Monteiro | b18a3f6 | 2017-09-19 04:25:51 +0100 | [diff] [blame] | 88 | # [H203] Use assertIs(Not)None to check for None. |
| 89 | # [H204] Use assert(Not)Equal to check for equality. |
| 90 | # [H205] Use assert(Greater|Less)(Equal) for comparison. |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame] | 91 | # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls |
Felipe Monteiro | b18a3f6 | 2017-09-19 04:25:51 +0100 | [diff] [blame] | 92 | # [H904] Delay string interpolations at logging calls. |
| 93 | enable-extensions = H106,H203,H204,H205,H210,H904 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 94 | show-source = True |
Felipe Monteiro | 4bf66a2 | 2017-05-07 14:44:21 +0100 | [diff] [blame] | 95 | # E123, E125 skipped as they are invalid PEP-8. |
Felipe Monteiro | f6eb862 | 2017-08-06 06:08:02 +0100 | [diff] [blame] | 96 | # |
| 97 | # H405 is another one that is good as a guideline, but sometimes |
| 98 | # multiline doc strings just don't have a natural summary |
| 99 | # line. Rejecting code for this reason is wrong. |
| 100 | ignore = E123,E125,H405 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 101 | builtins = _ |
| 102 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
Felipe Monteiro | 0854ded | 2017-05-05 16:30:55 +0100 | [diff] [blame] | 103 | |
| 104 | [hacking] |
| 105 | local-check-factory = patrole_tempest_plugin.hacking.checks.factory |
Doug Hellmann | 8669a51 | 2018-03-22 17:42:03 -0400 | [diff] [blame] | 106 | |
| 107 | [testenv:lower-constraints] |
| 108 | basepython = python3 |
| 109 | deps = |
| 110 | -c{toxinidir}/lower-constraints.txt |
| 111 | -r{toxinidir}/test-requirements.txt |
| 112 | -r{toxinidir}/requirements.txt |