The new stable upper-constraints file is only available after the openstack/requirements repository is branched. This will happen around the RC1 timeframe. Recheck and merge this change once the requirements repository has been branched. The CI system will work with this patch before the requirements repository is branched because zuul configues the job to run with a local copy of the file and defaults to the master branch. However, accepting the patch will break the test configuration on developers' local systems, so please wait until after the requirements repository is branched to merge the patch. Change-Id: Ieae081420f376dc51f42ffc4a805f42aaa3f29a7
101 lines
2.6 KiB
INI
101 lines
2.6 KiB
INI
[tox]
|
|
envlist = py{27,35},pep8,cover
|
|
minversion = 2.5
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
OS_TEST_PATH=monasca_common/tests
|
|
passenv = http_proxy
|
|
HTTP_PROXY
|
|
https_proxy
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
whitelist_externals = bash
|
|
find
|
|
rm
|
|
install_command = pip install {opts} {packages}
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
find {toxinidir} -type f -name '*.pyc' -delete
|
|
|
|
[testenv:py27]
|
|
basepython = python2.7
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
|
|
[testenv:py35]
|
|
basepython = python3.5
|
|
setenv =
|
|
{[testenv]setenv}
|
|
BLACKLIST_FILE={toxinidir}/test-blacklist-py3.txt
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run --blacklist-file {env:BLACKLIST_FILE} {posargs}
|
|
|
|
[testenv:cover]
|
|
basepython = python2.7
|
|
commands =
|
|
{[testenv]commands}
|
|
coverage erase
|
|
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_common
|
|
coverage report
|
|
|
|
[testenv:debug]
|
|
basepython = python3
|
|
commands =
|
|
{[testenv]commands}
|
|
oslo_debug_helper -t {env:OS_TEST_PATH} {posargs}
|
|
|
|
[testenv:bandit]
|
|
basepython = python3
|
|
# B101(assert_ussed) - Validation uses asserts because of performance reasons
|
|
# monasca_common/kafka_lib is a clone of kafka-python and will be deleted in the future
|
|
commands = bandit -r monasca_common -n5 -s B101 -x monasca_common/tests -x monasca_common/kafka_lib
|
|
|
|
[testenv:flake8]
|
|
basepython = python3
|
|
commands = flake8 monasca_common
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
commands =
|
|
{[testenv:flake8]commands}
|
|
{[testenv:bandit]commands}
|
|
python setup.py check --restructuredtext --strict
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[testenv:bindep]
|
|
basepython = python3
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
[flake8]
|
|
max-complexity = 50
|
|
max-line-length = 100
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,*egg,build
|
|
show-source = True
|
|
# note: Due to the need to fork kafka-python, many pep8 violations occure.
|
|
# All of the below ignores are caused by the forked kafka-python library
|
|
# so when monasca migrates to pykafka, the below line can be removed.
|
|
ignore = H101,H301,H404,H405
|
|
|
|
[testenv:lower-constraints]
|
|
basepython = python3
|
|
setenv = {[testenv:py35]setenv}
|
|
deps =
|
|
-c{toxinidir}/lower-constraints.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
commands = {[testenv:py35]commands}
|