blob: b7e02e6a4db3c73eb421f68cdc58bba0f0bc37b9 [file] [log] [blame]
DavidPurcell663aedf2017-01-03 10:01:14 -05001[tox]
Manik Bindlishd771e342018-11-02 05:02:36 +00002minversion = 2.0
Ghanshyam Mann35062ad2019-04-22 03:57:35 +00003envlist = pep8,py36,py37,py27
DavidPurcell663aedf2017-01-03 10:01:14 -05004skipsdist = True
5
6[testenv]
7usedevelop = True
8install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
9setenv =
10 VIRTUAL_ENV={envdir}
Felipe Monteiro7de19052017-08-06 05:47:27 +010011 OS_TEST_PATH=./patrole_tempest_plugin/tests/unit
12 LANGUAGE=en_US
13 LC_ALL=en_US.utf-8
DavidPurcell663aedf2017-01-03 10:01:14 -050014 PYTHONWARNINGS=default::DeprecationWarning
Felipe Monteiro5fa20f72017-12-01 02:09:08 +000015passenv = 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 Monteirodf958702017-02-27 03:53:50 +000016whitelist_externals = find
DavidPurcell029d8c32017-01-06 15:27:41 -050017deps = -r{toxinidir}/requirements.txt
18 -r{toxinidir}/test-requirements.txt
Jeremy Liue1014be2017-03-22 18:33:00 -070019commands =
DavidPurcell029d8c32017-01-06 15:27:41 -050020 find . -type f -name "*.pyc" -delete
Felipe Monteiro5fa20f72017-12-01 02:09:08 +000021 stestr --test-path ./patrole_tempest_plugin/tests/unit run {posargs}
DavidPurcell663aedf2017-01-03 10:01:14 -050022
23[testenv:pep8]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080024basepython = python3
Gage Hugo0f73e7c2018-08-21 15:51:08 -050025deps =
26 -r{toxinidir}/test-requirements.txt
27commands =
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 Monteirodf958702017-02-27 03:53:50 +000031
32[testenv:uuidgen]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080033basepython = python3
Jeremy Liu78b19252017-04-01 16:19:09 +080034commands = check-uuid --package patrole_tempest_plugin.tests.api --fix
DavidPurcell663aedf2017-01-03 10:01:14 -050035
36[testenv:venv]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080037basepython = python3
DavidPurcell663aedf2017-01-03 10:01:14 -050038commands = {posargs}
39
40[testenv:cover]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080041basepython = python3
Joseph Abadae7d7bb2017-04-19 12:07:13 -040042commands = rm -rf *.pyc
43 rm -rf cover
44 rm -f .coverage
45 nosetests {posargs}
Felipe Monteiro1ee5f4d2017-03-04 18:07:27 +000046setenv = 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
53whitelist_externals = nosetests
Joseph Abadae7d7bb2017-04-19 12:07:13 -040054 rm
DavidPurcell663aedf2017-01-03 10:01:14 -050055
56[testenv:docs]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080057basepython = python3
ghanshyam932b81d2018-03-14 02:07:33 +000058deps =
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
62commands =
Felipe Monteiro47c43cb2018-11-05 17:15:30 +000063 rm -rf doc/build doc/source/framework/code
ghanshyam932b81d2018-03-14 02:07:33 +000064 sphinx-build -W -b html doc/source doc/build/html
65whitelist_externals = rm
DavidPurcell663aedf2017-01-03 10:01:14 -050066
Masayuki Igawa94e6b182019-09-18 15:08:56 +090067[testenv:pdf-docs]
68basepython = python3
69deps = {[testenv:docs]deps}
70whitelist_externals =
71 make
72commands =
73 sphinx-build -W -b latex doc/source doc/build/pdf
74 make -C doc/build/pdf
75
DavidPurcell663aedf2017-01-03 10:01:14 -050076[testenv:releasenotes]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080077basepython = python3
ghanshyam932b81d2018-03-14 02:07:33 +000078deps =
79 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
80 -r{toxinidir}/requirements.txt
81 -r{toxinidir}/doc/requirements.txt
DavidPurcell663aedf2017-01-03 10:01:14 -050082commands =
ghanshyam932b81d2018-03-14 02:07:33 +000083 rm -rf releasenotes/build
DavidPurcell663aedf2017-01-03 10:01:14 -050084 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
ghanshyam932b81d2018-03-14 02:07:33 +000085whitelist_externals = rm
DavidPurcell663aedf2017-01-03 10:01:14 -050086
87[testenv:debug]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080088basepython = python3
HaiJieZhangae9db6f2017-03-23 11:28:16 +080089commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs}
DavidPurcell663aedf2017-01-03 10:01:14 -050090
Felipe Monteiro098a8cd2017-09-20 21:31:27 +010091[testenv:genconfig]
huang.zhiping68f4c2f2018-06-09 20:26:49 +080092basepython = python3
Felipe Monteiro098a8cd2017-09-20 21:31:27 +010093commands = oslo-config-generator --config-file etc/config-generator.patrole.conf
94
DavidPurcell663aedf2017-01-03 10:01:14 -050095[flake8]
melissaml686e0d92018-01-26 01:07:42 +080096# [H106] Don't put vim configuration in source files.
Felipe Monteirob18a3f62017-09-19 04:25:51 +010097# [H203] Use assertIs(Not)None to check for None.
98# [H204] Use assert(Not)Equal to check for equality.
99# [H205] Use assert(Greater|Less)(Equal) for comparison.
melissaml686e0d92018-01-26 01:07:42 +0800100# [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
Felipe Monteirob18a3f62017-09-19 04:25:51 +0100101# [H904] Delay string interpolations at logging calls.
102enable-extensions = H106,H203,H204,H205,H210,H904
DavidPurcell663aedf2017-01-03 10:01:14 -0500103show-source = True
Felipe Monteiro4bf66a22017-05-07 14:44:21 +0100104# E123, E125 skipped as they are invalid PEP-8.
Felipe Monteirof6eb8622017-08-06 06:08:02 +0100105#
106# H405 is another one that is good as a guideline, but sometimes
107# multiline doc strings just don't have a natural summary
108# line. Rejecting code for this reason is wrong.
109ignore = E123,E125,H405
DavidPurcell663aedf2017-01-03 10:01:14 -0500110builtins = _
111exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Felipe Monteiro0854ded2017-05-05 16:30:55 +0100112
113[hacking]
114local-check-factory = patrole_tempest_plugin.hacking.checks.factory
Doug Hellmann8669a512018-03-22 17:42:03 -0400115
116[testenv:lower-constraints]
117basepython = python3
118deps =
119 -c{toxinidir}/lower-constraints.txt
120 -r{toxinidir}/test-requirements.txt
121 -r{toxinidir}/requirements.txt