blob: 6445c6485c9f846a4bb8b42e41207e6d503bc3e2 [file] [log] [blame]
DavidPurcell663aedf2017-01-03 10:01:14 -05001[tox]
DavidPurcell029d8c32017-01-06 15:27:41 -05002minversion = 1.6
Felipe Monteirodf958702017-02-27 03:53:50 +00003envlist = pep8,py35,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]
24commands = flake8 {posargs}
Jeremy Liu78b19252017-04-01 16:19:09 +080025 check-uuid --package patrole_tempest_plugin.tests.api
Felipe Monteirodf958702017-02-27 03:53:50 +000026
27[testenv:uuidgen]
Jeremy Liu78b19252017-04-01 16:19:09 +080028commands = check-uuid --package patrole_tempest_plugin.tests.api --fix
DavidPurcell663aedf2017-01-03 10:01:14 -050029
30[testenv:venv]
31commands = {posargs}
32
33[testenv:cover]
Joseph Abadae7d7bb2017-04-19 12:07:13 -040034commands = rm -rf *.pyc
35 rm -rf cover
36 rm -f .coverage
37 nosetests {posargs}
Felipe Monteiro1ee5f4d2017-03-04 18:07:27 +000038setenv = VIRTUAL_ENV={envdir}
39 NOSE_WITH_COVERAGE=1
40 NOSE_COVER_BRANCHES=1
41 NOSE_COVER_PACKAGE=patrole_tempest_plugin
42 NOSE_COVER_HTML=1
43 NOSE_COVER_HTML_DIR={toxinidir}/cover
44 NOSE_WHERE=patrole_tempest_plugin/tests/unit
45whitelist_externals = nosetests
Joseph Abadae7d7bb2017-04-19 12:07:13 -040046 rm
DavidPurcell663aedf2017-01-03 10:01:14 -050047
48[testenv:docs]
ghanshyam932b81d2018-03-14 02:07:33 +000049deps =
50 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
51 -r{toxinidir}/requirements.txt
52 -r{toxinidir}/doc/requirements.txt
53commands =
54 rm -rf doc/build
55 sphinx-build -W -b html doc/source doc/build/html
56whitelist_externals = rm
DavidPurcell663aedf2017-01-03 10:01:14 -050057
58[testenv:releasenotes]
ghanshyam932b81d2018-03-14 02:07:33 +000059deps =
60 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
61 -r{toxinidir}/requirements.txt
62 -r{toxinidir}/doc/requirements.txt
DavidPurcell663aedf2017-01-03 10:01:14 -050063commands =
ghanshyam932b81d2018-03-14 02:07:33 +000064 rm -rf releasenotes/build
DavidPurcell663aedf2017-01-03 10:01:14 -050065 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
ghanshyam932b81d2018-03-14 02:07:33 +000066whitelist_externals = rm
DavidPurcell663aedf2017-01-03 10:01:14 -050067
68[testenv:debug]
HaiJieZhangae9db6f2017-03-23 11:28:16 +080069commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs}
DavidPurcell663aedf2017-01-03 10:01:14 -050070
Felipe Monteiro098a8cd2017-09-20 21:31:27 +010071[testenv:genconfig]
72commands = oslo-config-generator --config-file etc/config-generator.patrole.conf
73
DavidPurcell663aedf2017-01-03 10:01:14 -050074[flake8]
melissaml686e0d92018-01-26 01:07:42 +080075# [H106] Don't put vim configuration in source files.
Felipe Monteirob18a3f62017-09-19 04:25:51 +010076# [H203] Use assertIs(Not)None to check for None.
77# [H204] Use assert(Not)Equal to check for equality.
78# [H205] Use assert(Greater|Less)(Equal) for comparison.
melissaml686e0d92018-01-26 01:07:42 +080079# [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
Felipe Monteirob18a3f62017-09-19 04:25:51 +010080# [H904] Delay string interpolations at logging calls.
81enable-extensions = H106,H203,H204,H205,H210,H904
DavidPurcell663aedf2017-01-03 10:01:14 -050082show-source = True
Felipe Monteiro4bf66a22017-05-07 14:44:21 +010083# E123, E125 skipped as they are invalid PEP-8.
Felipe Monteirof6eb8622017-08-06 06:08:02 +010084#
85# H405 is another one that is good as a guideline, but sometimes
86# multiline doc strings just don't have a natural summary
87# line. Rejecting code for this reason is wrong.
88ignore = E123,E125,H405
DavidPurcell663aedf2017-01-03 10:01:14 -050089builtins = _
90exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Felipe Monteiro0854ded2017-05-05 16:30:55 +010091
92[hacking]
93local-check-factory = patrole_tempest_plugin.hacking.checks.factory