blob: a419c620c3fb434ec6ad4f47e2f34ba7cb8d5ba1 [file] [log] [blame]
Michael Johnson34139b02017-03-15 10:31:10 -07001[tox]
2minversion = 2.0
Carlos Goncalves436dd9f2019-02-12 22:08:00 +01003envlist = pep8
Michael Johnson34139b02017-03-15 10:31:10 -07004skipsdist = True
5
6[testenv]
7usedevelop = True
Michael Johnsonf298ed02019-06-28 16:00:38 -07008install_command = pip install {opts} {packages}
Michael Johnson34139b02017-03-15 10:31:10 -07009setenv =
10 VIRTUAL_ENV={envdir}
11 PYTHONWARNINGS=default::DeprecationWarning
Michael Johnsonf298ed02019-06-28 16:00:38 -070012deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
13 -r{toxinidir}/test-requirements.txt
Michael Johnson0f28a482018-05-23 16:22:45 -070014commands =
15 stestr run {posargs}
16 stestr slowest
Michael Johnson34139b02017-03-15 10:31:10 -070017
18[testenv:pep8]
huang.zhipingce50c732018-06-09 18:52:30 +080019basepython = python3
Brian Haley0ae7f102020-03-20 11:14:44 -040020commands = flake8
Michael Johnson34139b02017-03-15 10:31:10 -070021
22[testenv:venv]
huang.zhipingce50c732018-06-09 18:52:30 +080023basepython = python3
Michael Johnson34139b02017-03-15 10:31:10 -070024commands = {posargs}
25
26[testenv:cover]
huang.zhipingce50c732018-06-09 18:52:30 +080027basepython = python3
Michael Johnson0f28a482018-05-23 16:22:45 -070028setenv =
29 {[testenv]setenv}
30 PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode
31whitelist_externals =
32 find
33commands =
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 Johnson34139b02017-03-15 10:31:10 -070040
41[testenv:docs]
huang.zhipingce50c732018-06-09 18:52:30 +080042basepython = python3
Jude Cross986e3f52017-07-24 14:57:20 -070043deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070044 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070045 -r{toxinidir}/requirements.txt
Michael Johnsona5074252020-06-30 10:28:09 -070046 -r{toxinidir}/test-requirements.txt
Jude Cross986e3f52017-07-24 14:57:20 -070047 -r{toxinidir}/doc/requirements.txt
48whitelist_externals = rm
49commands =
50 rm -rf doc/build
51 sphinx-build -W -b html doc/source doc/build/html
Michael Johnson34139b02017-03-15 10:31:10 -070052
Michael Johnson791fefb2019-09-13 10:48:05 -070053[testenv:pdf-docs]
54basepython = python3
55deps = {[testenv:docs]deps}
56whitelist_externals =
57 make
58 rm
59commands =
60 rm -rf doc/build/pdf
61 sphinx-build -W -b latex doc/source doc/build/pdf
62 make -C doc/build/pdf
63
Michael Johnson34139b02017-03-15 10:31:10 -070064[testenv:releasenotes]
huang.zhipingce50c732018-06-09 18:52:30 +080065basepython = python3
Jude Cross986e3f52017-07-24 14:57:20 -070066deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070067 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070068 -r{toxinidir}/requirements.txt
69 -r{toxinidir}/doc/requirements.txt
Michael Johnson34139b02017-03-15 10:31:10 -070070commands =
71 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
72
73[testenv:debug]
huang.zhipingce50c732018-06-09 18:52:30 +080074basepython = python3
Michael Johnson34139b02017-03-15 10:31:10 -070075commands = oslo_debug_helper {posargs}
76
77[flake8]
Michael Johnson34139b02017-03-15 10:31:10 -070078show-source = True
Michael Johnson34139b02017-03-15 10:31:10 -070079builtins = _
80exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Brian Haley0ae7f102020-03-20 11:14:44 -040081import-order-style = pep8
82# [H106]: Don't put vim configuration in source files
83# [H203]: Use assertIs(Not)None to check for None
84# [H204]: Use assert(Not)Equal to check for equality
85# [H205]: Use assert(Greater|Less)(Equal) for comparison
86# [H904]: Delay string interpolations at logging calls
87enable-extensions=H106,H203,H204,H205,H904
Jude Cross986e3f52017-07-24 14:57:20 -070088
Michael Johnsona5074252020-06-30 10:28:09 -070089[flake8:local-plugins]
90extension =
91 O316 = checks:assert_true_instance
92 O318 = checks:assert_equal_or_not_none
93 O323 = checks:assert_equal_true_or_false
94 O324 = checks:no_mutable_default_args
95 O338 = checks:assert_equal_in
96 O339 = checks:no_log_warn
97 O341 = checks:no_translate_logs
98 O342 = checks:check_raised_localized_exceptions
99 O345 = checks:check_no_eventlet_imports
100 O346 = checks:check_line_continuation_no_backslash
101 O347 = checks:revert_must_have_kwargs
102 O348 = checks:check_no_logging_imports
103 O349 = checks:check_no_import_mock
104paths =
105 ./octavia_tempest_plugin/hacking
106
Jude Cross986e3f52017-07-24 14:57:20 -0700107[testenv:genconfig]
huang.zhipingce50c732018-06-09 18:52:30 +0800108basepython = python3
Jude Cross986e3f52017-07-24 14:57:20 -0700109whitelist_externals = mkdir
110commands =
111 mkdir -p etc
112 oslo-config-generator --output-file etc/octavia.tempest.conf.sample \
113 --namespace tempest.config