blob: bba0a641fdc0f8b3eb9c8eb709159b1074b0f3d6 [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
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}
11 PYTHONWARNINGS=default::DeprecationWarning
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070012 OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
13 OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
14 OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
Chandan Kumar5e619872017-09-07 22:23:55 +053015deps = -r{toxinidir}/test-requirements.txt
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070016commands = stestr run --slowest {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053017
18[testenv:pep8]
Dongcan Ye63813952017-11-18 14:22:25 +080019commands =
20 sh ./tools/misc-sanity-checks.sh
Brian Haley33ef4602018-04-26 14:37:49 -040021 flake8
Dongcan Ye63813952017-11-18 14:22:25 +080022whitelist_externals =
23 sh
Chandan Kumar5e619872017-09-07 22:23:55 +053024
25[testenv:venv]
26commands = {posargs}
27
28[testenv:cover]
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070029setenv =
30 {[testenv]setenv}
31 PYTHON=coverage run --source neutron_tempest_plugin --parallel-mode
32commands =
33 stestr run --no-subunit-trace {posargs}
34 coverage combine
35 coverage html -d cover
36 coverage xml -o cover/coverage.xml
Chandan Kumar5e619872017-09-07 22:23:55 +053037
38[testenv:docs]
39commands = python setup.py build_sphinx
40
41[testenv:releasenotes]
42commands =
43 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
44
45[testenv:debug]
Manjeet Singh Bhatia3448e0b2018-02-14 10:41:11 -080046commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053047
48[flake8]
Chandan Kumar667d3d32017-09-22 12:24:06 +053049# E125 continuation line does not distinguish itself from next logical line
50# E126 continuation line over-indented for hanging indent
51# E128 continuation line under-indented for visual indent
52# E129 visually indented line with same indent as next logical line
53# E265 block comment should start with '# '
54# H404 multi line docstring should start with a summary
55# H405 multi line docstring summary not separated with an empty line
56# N530 direct neutron imports not allowed
Brian Haley6767cec2018-04-10 15:30:23 -040057ignore = E125,E126,E128,E129,E265,H404,H405,N530
Chandan Kumar667d3d32017-09-22 12:24:06 +053058# H106: Don't put vim configuration in source files
59# H203: Use assertIs(Not)None to check for None
60# H904: Delay string interpolations at logging calls
Brian Haley6767cec2018-04-10 15:30:23 -040061enable-extensions = H106,H203,H904
Chandan Kumar667d3d32017-09-22 12:24:06 +053062show-source = true
Brian Haley6767cec2018-04-10 15:30:23 -040063exclude = ./.*,build,dist,doc,*egg*,releasenotes
Chandan Kumar667d3d32017-09-22 12:24:06 +053064import-order-style = pep8