blob: 5d1a40e1ece61435c1ad01be9dbf2b8137bc402d [file] [log] [blame]
Michael Johnson34139b02017-03-15 10:31:10 -07001[tox]
Brian Haley47e45892020-05-19 15:56:11 -04002minversion = 3.1
Carlos Goncalves436dd9f2019-02-12 22:08:00 +01003envlist = pep8
Michael Johnson34139b02017-03-15 10:31:10 -07004skipsdist = True
Brian Haley47e45892020-05-19 15:56:11 -04005ignore_basepython_conflict = True
Michael Johnson34139b02017-03-15 10:31:10 -07006
7[testenv]
Brian Haley47e45892020-05-19 15:56:11 -04008basepython = python3
Michael Johnson34139b02017-03-15 10:31:10 -07009usedevelop = True
Michael Johnsonf298ed02019-06-28 16:00:38 -070010install_command = pip install {opts} {packages}
Michael Johnson34139b02017-03-15 10:31:10 -070011setenv =
12 VIRTUAL_ENV={envdir}
13 PYTHONWARNINGS=default::DeprecationWarning
Michael Johnsonf298ed02019-06-28 16:00:38 -070014deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
15 -r{toxinidir}/test-requirements.txt
Michael Johnson0f28a482018-05-23 16:22:45 -070016commands =
17 stestr run {posargs}
18 stestr slowest
Michael Johnson34139b02017-03-15 10:31:10 -070019
20[testenv:pep8]
Brian Haley0ae7f102020-03-20 11:14:44 -040021commands = flake8
Michael Johnson34139b02017-03-15 10:31:10 -070022
23[testenv:venv]
24commands = {posargs}
25
26[testenv:cover]
Michael Johnson0f28a482018-05-23 16:22:45 -070027setenv =
28 {[testenv]setenv}
29 PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode
30whitelist_externals =
31 find
32commands =
33 find octavia_tempest_plugin -type f -name "*.pyc" -delete
34 coverage erase
35 stestr run {posargs}
36 coverage combine
37 coverage html -d cover
38 coverage xml -o cover/coverage.xml
Michael Johnson34139b02017-03-15 10:31:10 -070039
40[testenv:docs]
Jude Cross986e3f52017-07-24 14:57:20 -070041deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070042 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070043 -r{toxinidir}/requirements.txt
44 -r{toxinidir}/doc/requirements.txt
45whitelist_externals = rm
46commands =
47 rm -rf doc/build
48 sphinx-build -W -b html doc/source doc/build/html
Michael Johnson34139b02017-03-15 10:31:10 -070049
Michael Johnson791fefb2019-09-13 10:48:05 -070050[testenv:pdf-docs]
Michael Johnson791fefb2019-09-13 10:48:05 -070051deps = {[testenv:docs]deps}
52whitelist_externals =
53 make
54 rm
55commands =
56 rm -rf doc/build/pdf
57 sphinx-build -W -b latex doc/source doc/build/pdf
58 make -C doc/build/pdf
59
Michael Johnson34139b02017-03-15 10:31:10 -070060[testenv:releasenotes]
Jude Cross986e3f52017-07-24 14:57:20 -070061deps =
Michael Johnsonf298ed02019-06-28 16:00:38 -070062 -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
Jude Cross986e3f52017-07-24 14:57:20 -070063 -r{toxinidir}/requirements.txt
64 -r{toxinidir}/doc/requirements.txt
Michael Johnson34139b02017-03-15 10:31:10 -070065commands =
66 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
67
68[testenv:debug]
69commands = oslo_debug_helper {posargs}
70
71[flake8]
Michael Johnson34139b02017-03-15 10:31:10 -070072show-source = True
Michael Johnson34139b02017-03-15 10:31:10 -070073builtins = _
74exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
Brian Haley0ae7f102020-03-20 11:14:44 -040075import-order-style = pep8
76# [H106]: Don't put vim configuration in source files
77# [H203]: Use assertIs(Not)None to check for None
78# [H204]: Use assert(Not)Equal to check for equality
79# [H205]: Use assert(Greater|Less)(Equal) for comparison
80# [H904]: Delay string interpolations at logging calls
81enable-extensions=H106,H203,H204,H205,H904
Jude Cross986e3f52017-07-24 14:57:20 -070082
83[testenv:genconfig]
84whitelist_externals = mkdir
85commands =
86 mkdir -p etc
87 oslo-config-generator --output-file etc/octavia.tempest.conf.sample \
88 --namespace tempest.config
Brian Haley47e45892020-05-19 15:56:11 -040089
90[testenv:requirements]
91deps =
92 -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
93whitelist_externals = sh
94commands =
95 sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'