monasca-api/tox.ini

108 lines
2.4 KiB
INI

[tox]
envlist = py27,pep8,cover
minversion = 2.1
skipsdist = True
[testenv]
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=monasca_api/tests
CLIENT_NAME=monasca-api
passenv = http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
usedevelop = True
install_command =
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = bash
find
rm
commands =
find . -type f -name "*.pyc" -delete
[testenv:py27]
basepython = python2.7
deps =
{[testenv]deps}
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:py35]
basepython = python3.5
deps =
{[testenv]deps}
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:cover]
basepython = python2.7
deps =
{[testenv]deps}
commands =
{[testenv]commands}
coverage erase
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_api
coverage report
[testenv:debug]
deps =
{[testenv]deps}
commands =
{[testenv]commands}
oslo_debug_helper -t ./monasca_api/tests {posargs}
[testenv:flake8]
commands =
flake8 monasca_api
flake8 monasca_tempest_tests
[testenv:bandit]
commands =
# B101(assert_ussed) - API uses asserts because of performance reasons
bandit -r monasca_api -n5 -s B101 -x monasca_api/tests
# B101(assert_ussed) - asserts in test layers seems appropriate
bandit -r monasca_tempest_tests -n5 -s B101
[testenv:bashate]
whitelist_externals = bashate
commands =
# Ignore too long lines error E006 from bashate and treat
# E005, E042 as errors.
bashate -v -iE006 -eE005,E042 devstack/plugin.sh
[testenv:pep8]
deps =
{[testenv]deps}
commands =
{[testenv:flake8]commands}
{[testenv:bandit]commands}
{[testenv:bashate]commands}
[testenv:venv]
commands = {posargs}
[testenv:bindep]
deps = bindep
commands = bindep test
[flake8]
# TODO: ignored checks should be enabled in the future
# H201 no 'except:' at least use 'except Exception:'
# H302 import only modules
# H405 multi line docstring summary not separated with an empty line
ignore = F821,H201,H302,H405
max-complexity = 50
max-line-length = 120
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build
show-source = True
[hacking]