nodepool/tox.ini
David Shrewsbury a0dca6ae12 Allow testing with external zookeeper
It can be handy to test against an already running zookeeper, rather
than requiring one be installed in your test environment. Allow for
that by using the NODEPOOL_ZK_HOST environment variable.

This also gives each ZKTestCase based test a pre-existing client
connection that can be used for testing. To avoid znode path conflicts,
each connection is chroot'ed under /nodepool_test/{uniqueInt}. We
attempt to remove the {uniqueInt} znode and children as part of the
test cleanup (also removed at setUp time if cleanup fails). This will
leave a single znode for /nodepool_test, but if many tests fail for
some reason, it is easier to remove a single root node rather than
potentially many of them if we do not chroot.

Change-Id: I4fd61b16353c16bed2744e0d863ce188019430cd
2016-07-07 16:32:06 -04:00

38 lines
777 B
INI

[tox]
minversion = 1.6
skipsdist = True
envlist = pep8, py27
[testenv]
# Set STATSD env variables so that statsd code paths are tested.
setenv = STATSD_HOST=localhost
STATSD_PORT=8125
VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = NODEPOOL_ZK_HOST
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8 nodepool
[testenv:cover]
commands =
python setup.py testr --coverage
[testenv:docs]
commands =
python setup.py build_sphinx
[testenv:venv]
commands = {posargs}
[flake8]
ignore = E123,E125,H
select = H231,F
show-source = True
exclude = .venv,.tox,dist,doc,build,*.egg