blob: daf728a53808d6495153a9e4c944273356f81e08 [file] [log] [blame]
Chandan Kumar5e619872017-09-07 22:23:55 +05301[tox]
2minversion = 2.0
Brian Haley33ef4602018-04-26 14:37:49 -04003envlist = pep8
Chandan Kumar5e619872017-09-07 22:23:55 +05304skipsdist = True
5
6[testenv]
7usedevelop = True
Chandan Kumar5e619872017-09-07 22:23:55 +05308setenv =
9 VIRTUAL_ENV={envdir}
10 PYTHONWARNINGS=default::DeprecationWarning
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070011 OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
12 OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
13 OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
Doug Wiegley6b03ab12019-03-01 10:23:57 -070014install_command =
15 pip install {opts} {packages}
16deps =
caoyuand49cf7a2019-04-23 19:38:35 +080017 -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
Doug Wiegley6b03ab12019-03-01 10:23:57 -070018 -r{toxinidir}/test-requirements.txt
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070019commands = stestr run --slowest {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053020
21[testenv:pep8]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070022basepython = python3
Dongcan Ye63813952017-11-18 14:22:25 +080023commands =
24 sh ./tools/misc-sanity-checks.sh
Brian Haley33ef4602018-04-26 14:37:49 -040025 flake8
Dongcan Ye63813952017-11-18 14:22:25 +080026whitelist_externals =
27 sh
Chandan Kumar5e619872017-09-07 22:23:55 +053028
29[testenv:venv]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070030basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053031commands = {posargs}
32
33[testenv:cover]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070034basepython = python3
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070035setenv =
36 {[testenv]setenv}
37 PYTHON=coverage run --source neutron_tempest_plugin --parallel-mode
38commands =
39 stestr run --no-subunit-trace {posargs}
40 coverage combine
41 coverage html -d cover
42 coverage xml -o cover/coverage.xml
Chandan Kumar5e619872017-09-07 22:23:55 +053043
44[testenv:docs]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070045basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053046commands = python setup.py build_sphinx
47
48[testenv:releasenotes]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070049basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053050commands =
51 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
52
53[testenv:debug]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070054basepython = python3
Manjeet Singh Bhatia3448e0b2018-02-14 10:41:11 -080055commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053056
57[flake8]
Chandan Kumar667d3d32017-09-22 12:24:06 +053058# E125 continuation line does not distinguish itself from next logical line
59# E126 continuation line over-indented for hanging indent
60# E128 continuation line under-indented for visual indent
61# E129 visually indented line with same indent as next logical line
Chandan Kumar667d3d32017-09-22 12:24:06 +053062# N530 direct neutron imports not allowed
Brian Haleyaee61ac2018-10-09 20:00:27 -040063ignore = E125,E126,E128,E129,N530
Chandan Kumar667d3d32017-09-22 12:24:06 +053064# H106: Don't put vim configuration in source files
65# H203: Use assertIs(Not)None to check for None
Brian Haleyd4fa6dc2019-06-27 11:31:55 -040066# H204: Use assert(Not)Equal to check for equality
67# H205: Use assert(Greater|Less)(Equal) for comparison
Chandan Kumar667d3d32017-09-22 12:24:06 +053068# H904: Delay string interpolations at logging calls
Brian Haleyd4fa6dc2019-06-27 11:31:55 -040069enable-extensions = H106,H203,H204,H205,H904
Chandan Kumar667d3d32017-09-22 12:24:06 +053070show-source = true
Brian Haley6767cec2018-04-10 15:30:23 -040071exclude = ./.*,build,dist,doc,*egg*,releasenotes
Chandan Kumar667d3d32017-09-22 12:24:06 +053072import-order-style = pep8