Files
monasca-api/tox.ini
Tomasz Trębski 175577d35b Validate all bash files inside devstack
Previously only plugin.sh was validated.
At the monent some parts of the plugin
were moved under devstack/lib to increase plugin.sh
readability. Those files were not validated.

Note:
    Tweaked a tox.ini by removing installing the monasca-api
    package in environments that do not actually need it.
    Also removed redundant references to main environment
    dependencies.

Change-Id: I43381647228fad99603b5717c37496e80f409d4f
2017-07-12 06:28:07 +00:00

101 lines
2.4 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[tox]
envlist = py27,pep8,cover
minversion = 2.7
skipsdist = True
[testenv]
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=monasca_api/tests
CLIENT_NAME=monasca-api
passenv = *_proxy
*_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}/test-requirements.txt
whitelist_externals = bash
find
rm
commands =
find . -type f -name "*.pyc" -delete
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:py35]
basepython = python3.5
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:cover]
basepython = python2.7
commands =
{[testenv]commands}
coverage erase
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_api --omit=monasca_api/hacking/*
coverage report
[testenv:debug]
commands =
{[testenv]commands}
oslo_debug_helper -t ./monasca_api/tests {posargs}
[testenv:flake8]
skip_install = True
usedevelop = False
commands =
{[testenv]commands}
flake8 monasca_api monasca_tempest_tests --statistics
[testenv:bandit]
skip_install = True
usedevelop = False
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]
skip_install = True
usedevelop = False
commands = bash {toxinidir}/tools/bashate.sh
[testenv:pep8]
skip_install = True
usedevelop = False
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
# H106: Dont put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
enable-extensions=H106,H203
max-complexity = 50
max-line-length = 120
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build
show-source = True
[hacking]
local-check-factory = monasca_api.hacking.checks.factory