blob: 5eb8b10bebb2e8408f5525357dea8155dc6c345e [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]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070019basepython = python3
Dongcan Ye63813952017-11-18 14:22:25 +080020commands =
21 sh ./tools/misc-sanity-checks.sh
Brian Haley33ef4602018-04-26 14:37:49 -040022 flake8
Dongcan Ye63813952017-11-18 14:22:25 +080023whitelist_externals =
24 sh
Chandan Kumar5e619872017-09-07 22:23:55 +053025
26[testenv:venv]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070027basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053028commands = {posargs}
29
30[testenv:cover]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070031basepython = python3
Slawek Kaplonskiaa6baae2018-05-21 15:20:27 -070032setenv =
33 {[testenv]setenv}
34 PYTHON=coverage run --source neutron_tempest_plugin --parallel-mode
35commands =
36 stestr run --no-subunit-trace {posargs}
37 coverage combine
38 coverage html -d cover
39 coverage xml -o cover/coverage.xml
Chandan Kumar5e619872017-09-07 22:23:55 +053040
41[testenv:docs]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070042basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053043commands = python setup.py build_sphinx
44
45[testenv:releasenotes]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070046basepython = python3
Chandan Kumar5e619872017-09-07 22:23:55 +053047commands =
48 sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
49
50[testenv:debug]
Tuan Do Anhdbd7d3f2018-07-03 14:18:18 +070051basepython = python3
Manjeet Singh Bhatia3448e0b2018-02-14 10:41:11 -080052commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs}
Chandan Kumar5e619872017-09-07 22:23:55 +053053
54[flake8]
Chandan Kumar667d3d32017-09-22 12:24:06 +053055# E125 continuation line does not distinguish itself from next logical line
56# E126 continuation line over-indented for hanging indent
57# E128 continuation line under-indented for visual indent
58# E129 visually indented line with same indent as next logical line
59# E265 block comment should start with '# '
60# H404 multi line docstring should start with a summary
61# H405 multi line docstring summary not separated with an empty line
62# N530 direct neutron imports not allowed
Brian Haley6767cec2018-04-10 15:30:23 -040063ignore = E125,E126,E128,E129,E265,H404,H405,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
66# H904: Delay string interpolations at logging calls
Brian Haley6767cec2018-04-10 15:30:23 -040067enable-extensions = H106,H203,H904
Chandan Kumar667d3d32017-09-22 12:24:06 +053068show-source = true
Brian Haley6767cec2018-04-10 15:30:23 -040069exclude = ./.*,build,dist,doc,*egg*,releasenotes
Chandan Kumar667d3d32017-09-22 12:24:06 +053070import-order-style = pep8