# 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, pylint, py27, py36 # 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://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \ {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -e{[tox]stxdir}/fault/fm-api -e{[tox]stxdir}/config/tsconfig/tsconfig -e{[tox]stxdir}/config/sysinv/sysinv/sysinv commands = find . -type f -name "*.pyc" -delete [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} [testenv:py27] basepython = python2.7 deps = {[testenv]deps} commands = {[testenv]commands} stestr run {posargs} stestr slowest [testenv:py36] basepython = python3.6 deps = {[testenv]deps} commands = {[testenv]commands} stestr run {posargs} stestr slowest [flake8] # H series are hacking # H101: Use TODO(NAME) # H102: Apache 2.0 license header not found # H104: File contains nothing but comments # H306: imports not in alphabetical order # H401: docstring should not start with a space # 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,H306,H401,H404,H405 exclude = build [testenv:cover] basepython = python2.7 deps = {[testenv]deps} commands = coverage erase python setup.py testr --coverage --testr-args='{posargs}' coverage xml coverage report