config/controllerconfig/controllerconfig/tox.ini

67 lines
2.2 KiB
INI

# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = flake8, py27, pylint
# Tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_cctox
stxdir = {toxinidir}/../../..
[testenv]
whitelist_externals = find
install_command = pip install --no-cache-dir -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/stx-config/configutilities/configutilities
-e{[tox]stxdir}/stx-fault/fm-api
-e{[tox]stxdir}/stx-update/tsconfig/tsconfig
-e{[tox]stxdir}/stx-config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/stx-config/sysinv/cgts-client/cgts-client
[testenv:venv]
commands = {posargs}
[testenv:pylint]
basepython = python2.7
deps = {[testenv]deps}
commands = pylint {posargs} controllerconfig --rcfile=./pylint.rc --extension-pkg-whitelist=netifaces
[testenv:flake8]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
commands = flake8 {posargs}
[flake8]
# H series are hacking
# H101: Use TODO(NAME)
# H102: Apache 2.0 license header not found
# H104: File contains nothing but comments
# H232: Python 3.x incompatible octal 400 should be written as 0o400
# H238: old style class declaration, use new style (inherit from `object`)
# H301: one import per line
# H306: imports not in alphabetical order
# H401: docstring should not start with a space
# H403: multi line docstrings should end on a new line
# H404: multi line docstring should start without a leading new line
# H405: multi line docstring summary not separated with an empty line
ignore = H101,H102,H104,H232,H238,H301,H306,H401,H403,H404,H405
exclude = build
[testenv:py27]
basepython = python2.7
commands =
find . -type f -name "*.pyc" -delete
py.test {posargs}
[testenv:cover]
basepython = python2.7
deps = {[testenv]deps}
commands =
coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
coverage xml