DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 1 | [tox] |
Ghanshyam Mann | 51368ef | 2020-02-03 13:19:03 -0600 | [diff] [blame] | 2 | minversion = 3.1.1 |
| 3 | envlist = pep8,py36,py37 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 4 | skipsdist = True |
Ghanshyam Mann | 51368ef | 2020-02-03 13:19:03 -0600 | [diff] [blame] | 5 | ignore_basepython_conflict = True |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 6 | |
| 7 | [testenv] |
Ghanshyam Mann | 51368ef | 2020-02-03 13:19:03 -0600 | [diff] [blame] | 8 | basepython = python3 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 9 | usedevelop = True |
pengyuesheng | 8c23e7a | 2019-09-29 10:17:59 +0800 | [diff] [blame] | 10 | install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 11 | setenv = |
| 12 | VIRTUAL_ENV={envdir} |
Felipe Monteiro | 7de1905 | 2017-08-06 05:47:27 +0100 | [diff] [blame] | 13 | OS_TEST_PATH=./patrole_tempest_plugin/tests/unit |
| 14 | LANGUAGE=en_US |
| 15 | LC_ALL=en_US.utf-8 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 16 | PYTHONWARNINGS=default::DeprecationWarning |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 17 | 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] | 18 | whitelist_externals = find |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 19 | deps = -r{toxinidir}/requirements.txt |
| 20 | -r{toxinidir}/test-requirements.txt |
Jeremy Liu | e1014be | 2017-03-22 18:33:00 -0700 | [diff] [blame] | 21 | commands = |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 22 | find . -type f -name "*.pyc" -delete |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 23 | stestr --test-path ./patrole_tempest_plugin/tests/unit run {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 24 | |
| 25 | [testenv:pep8] |
Gage Hugo | 0f73e7c | 2018-08-21 15:51:08 -0500 | [diff] [blame] | 26 | deps = |
| 27 | -r{toxinidir}/test-requirements.txt |
| 28 | commands = |
| 29 | flake8 {posargs} |
| 30 | bandit -r patrole_tempest_plugin -x patrole_tempest_plugin/tests -n 5 |
| 31 | check-uuid --package patrole_tempest_plugin.tests.api |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 32 | |
| 33 | [testenv:uuidgen] |
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] |
| 37 | commands = {posargs} |
| 38 | |
| 39 | [testenv:cover] |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 40 | commands = rm -rf *.pyc |
| 41 | rm -rf cover |
| 42 | rm -f .coverage |
| 43 | nosetests {posargs} |
Felipe Monteiro | 1ee5f4d | 2017-03-04 18:07:27 +0000 | [diff] [blame] | 44 | setenv = VIRTUAL_ENV={envdir} |
| 45 | NOSE_WITH_COVERAGE=1 |
| 46 | NOSE_COVER_BRANCHES=1 |
| 47 | NOSE_COVER_PACKAGE=patrole_tempest_plugin |
| 48 | NOSE_COVER_HTML=1 |
| 49 | NOSE_COVER_HTML_DIR={toxinidir}/cover |
| 50 | NOSE_WHERE=patrole_tempest_plugin/tests/unit |
| 51 | whitelist_externals = nosetests |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 52 | rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 53 | |
| 54 | [testenv:docs] |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 55 | deps = |
pengyuesheng | 8c23e7a | 2019-09-29 10:17:59 +0800 | [diff] [blame] | 56 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 57 | -r{toxinidir}/requirements.txt |
| 58 | -r{toxinidir}/doc/requirements.txt |
| 59 | commands = |
Felipe Monteiro | 47c43cb | 2018-11-05 17:15:30 +0000 | [diff] [blame] | 60 | rm -rf doc/build doc/source/framework/code |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 61 | sphinx-build -W -b html doc/source doc/build/html |
| 62 | whitelist_externals = rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 63 | |
Masayuki Igawa | 94e6b18 | 2019-09-18 15:08:56 +0900 | [diff] [blame] | 64 | [testenv:pdf-docs] |
Masayuki Igawa | 94e6b18 | 2019-09-18 15:08:56 +0900 | [diff] [blame] | 65 | deps = {[testenv:docs]deps} |
| 66 | whitelist_externals = |
| 67 | make |
| 68 | commands = |
| 69 | sphinx-build -W -b latex doc/source doc/build/pdf |
| 70 | make -C doc/build/pdf |
| 71 | |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 72 | [testenv:releasenotes] |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 73 | deps = |
pengyuesheng | 8c23e7a | 2019-09-29 10:17:59 +0800 | [diff] [blame] | 74 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 75 | -r{toxinidir}/requirements.txt |
| 76 | -r{toxinidir}/doc/requirements.txt |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 77 | commands = |
ghanshyam | 932b81d | 2018-03-14 02:07:33 +0000 | [diff] [blame] | 78 | rm -rf releasenotes/build |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 79 | 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] | 80 | whitelist_externals = rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 81 | |
| 82 | [testenv:debug] |
HaiJieZhang | ae9db6f | 2017-03-23 11:28:16 +0800 | [diff] [blame] | 83 | commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 84 | |
Felipe Monteiro | 098a8cd | 2017-09-20 21:31:27 +0100 | [diff] [blame] | 85 | [testenv:genconfig] |
| 86 | commands = oslo-config-generator --config-file etc/config-generator.patrole.conf |
| 87 | |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 88 | [flake8] |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame] | 89 | # [H106] Don't put vim configuration in source files. |
Felipe Monteiro | b18a3f6 | 2017-09-19 04:25:51 +0100 | [diff] [blame] | 90 | # [H203] Use assertIs(Not)None to check for None. |
| 91 | # [H204] Use assert(Not)Equal to check for equality. |
| 92 | # [H205] Use assert(Greater|Less)(Equal) for comparison. |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame] | 93 | # [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] | 94 | # [H904] Delay string interpolations at logging calls. |
| 95 | enable-extensions = H106,H203,H204,H205,H210,H904 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 96 | show-source = True |
Felipe Monteiro | 4bf66a2 | 2017-05-07 14:44:21 +0100 | [diff] [blame] | 97 | # E123, E125 skipped as they are invalid PEP-8. |
Felipe Monteiro | f6eb862 | 2017-08-06 06:08:02 +0100 | [diff] [blame] | 98 | # |
| 99 | # H405 is another one that is good as a guideline, but sometimes |
| 100 | # multiline doc strings just don't have a natural summary |
| 101 | # line. Rejecting code for this reason is wrong. |
Andreas Jaeger | 2aad808 | 2020-03-28 19:25:15 +0100 | [diff] [blame] | 102 | # W504 line break after binary operator |
| 103 | ignore = E123,E125,H405,W504 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 104 | builtins = _ |
| 105 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
Felipe Monteiro | 0854ded | 2017-05-05 16:30:55 +0100 | [diff] [blame] | 106 | |
Andreas Jaeger | 2aad808 | 2020-03-28 19:25:15 +0100 | [diff] [blame] | 107 | [flake8:local-plugins] |
| 108 | extension = |
| 109 | T102 = checks:import_no_clients_in_api_tests |
| 110 | T105 = checks:no_setup_teardown_class_for_tests |
| 111 | T107 = checks:service_tags_not_in_module_path |
| 112 | T108 = checks:no_hyphen_at_end_of_rand_name |
| 113 | N322 = checks:no_mutable_default_args |
| 114 | T109 = checks:no_testtools_skip_decorator |
| 115 | T113 = checks:use_rand_uuid_instead_of_uuid4 |
| 116 | P100 = checks:no_rbac_rule_validation_decorator |
| 117 | P101 = checks:no_rbac_suffix_in_test_filename |
| 118 | P102 = checks:no_rbac_test_suffix_in_test_class_name |
| 119 | P103 = checks:no_client_alias_in_test_cases |
| 120 | P104 = checks:no_extension_rbac_test_suffix_in_plugin_test_class_name |
| 121 | paths = ./patrole_tempest_plugin/hacking |
Doug Hellmann | 8669a51 | 2018-03-22 17:42:03 -0400 | [diff] [blame] | 122 | |
| 123 | [testenv:lower-constraints] |
Doug Hellmann | 8669a51 | 2018-03-22 17:42:03 -0400 | [diff] [blame] | 124 | deps = |
| 125 | -c{toxinidir}/lower-constraints.txt |
| 126 | -r{toxinidir}/test-requirements.txt |
| 127 | -r{toxinidir}/requirements.txt |