designate/tox.ini
Kiall Mac Innes 1d8f7ff383 Set PYTHONDONTWRITEBYTECODE=1 in tox.ini
When switching between branches with DB migrations, leftover .pyc
files can cause all the tests to fail. Setting PYTHONDONTWRITEBYTECODE=1
prevents python from writing the .pyx files in the first place, at
a possible performance cost dueing test runs.

Change-Id: Ice380614be5401c3b5b1e76903a568a159dec0fb
2015-02-24 12:36:18 +00:00

87 lines
2.8 KiB
INI

[tox]
minversion = 1.6
envlist = py27,flake8
skipsdist = True
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# Note the hash seed is set to 0 until designate can be tested with a
# random hash seed successfully.
setenv =
PYTHONHASHSEED=0
PYTHONDONTWRITEBYTECODE=1
whitelist_externals = sh
commands =
sh tools/pretty_tox.sh '{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:flake8]
commands = flake8
[testenv:pep8]
commands = flake8
[testenv:pyflakes]
commands = flake8
[testenv:bashate]
deps = bashate
whitelist_externals = bash
commands = bash -c "find {toxinidir}/contrib/devstack \
-not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs
-not \( -type d -name doc -prune \) \ # skip documentation
-type f \ # only files
-not -name \*~ \ # skip editors, readme, etc
-not -name \*.md \
\( \
-name \*.sh -or \
-name \*rc -or \
-name functions\* -or \
-wholename \*/lib/\* \ # /lib files are shell, but
\) \ # have no extension
-print0 | xargs -0 bashate -v"
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_missing_reqs
-r{toxinidir}/requirements.txt
commands=pip-missing-reqs -d --ignore-file=designate/tests/* designate
[testenv:venv]
commands = {posargs}
[flake8]
# ignored flake8 codes:
# H302 import only modules
# H306 imports not in alphabetical order
# H402 one line docstring needs punctuation
# H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line
# H904 Wrap long lines in parentheses instead of a backslash
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
ignore = H302,H306,H402,H404,H405,H904,E126,E128
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools,contrib/designate-dashboard
[hacking]
local-check-factory = designate.hacking.checks.factory