oslo-incubator/tox.ini

110 lines
4.2 KiB
INI

[tox]
minversion = 1.6
envlist = py26,py27,py33,pep8,pylint
skipsdist = True
[testenv]
sitepackages = False
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
# Use the lockutils wrapper to ensure that external locking works correctly
# NOTE(bnemec): Due to dependencies between tests in the rpc module, those
# tests cannot currently be run in parallel. Because that module is
# deprecated, spending a lot of time fixing them would not be useful.
# Since we want to test everything else in parallel, however, we need
# to do two test runs: one in parallel with everything but rpc, and one
# serialized for the rpc module.
python -m openstack.common.lockutils python setup.py test --slowest --testr-args='(?!tests.unit.rpc)tests {posargs}'
python -m openstack.common.lockutils python setup.py test --slowest --testr-args='tests.unit.rpc --concurrency=1 {posargs}'
{toxinidir}/tools/config/generate_sample.sh -p openstack
# As long as we are filtering tests based on whether they run in parallel or
# not, it will not be possible to specify tests for tox to run by using the
# normal "tox -e py27 -- test_name". The "all" target allows that behavior
# to be used again: tox -e all -- test_name
[testenv:all]
setenv = VIRTUAL_ENV={envdir}
commands = python -m openstack.common.lockutils python setup.py test --slowest --testr-args='{posargs}'
[flake8]
show-source = True
ignore = H803
exclude = .venv,.tox,dist,doc,*.egg,.update-venv
[testenv:pep8]
commands = flake8 {posargs}
python ./tools/check_maintainers.py
{toxinidir}/tools/requirements_style_check.sh requirements.txt test-requirements.txt requirements-py3.txt test-requirements-py3.txt
[testenv:pylint]
deps = pylint>=0.26.0
commands = python ./tools/lint.py ./openstack
python ./tools/lint.py ./tests
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
commands =
# due to dependencies between tests (bug 1192207) we use `--concurrency=1` option
# Use the lockutils wrapper to ensure that external locking works correctly
python -m openstack.common.lockutils python setup.py test --coverage --testr-args='--concurrency=1 {posargs}'
[testenv:venv]
commands = {posargs}
[testenv:py33]
deps = -r{toxinidir}/requirements-py3.txt
-r{toxinidir}/test-requirements-py3.txt
nose
commands =
python -m openstack.common.lockutils \
nosetests tests/unit/apiclient/ \
tests/unit/cache/ \
tests/unit/db/sqlalchemy/test_options.py \
tests/unit/db/test_api.py \
tests/unit/db/sqlalchemy/test_models.py \
tests/unit/fixture/test_config.py \
tests/unit/fixture/test_mockpatch.py \
tests/unit/middleware/test_catch_errors.py \
tests/unit/middleware/test_correlation_id.py \
tests/unit/middleware/test_notifier.py \
tests/unit/middleware/test_request_id.py \
tests/unit/rpc/test_dispatcher.py \
tests/unit/scheduler/test_base_filter.py \
tests/unit/scheduler/test_host_filters.py \
tests/unit/test_cfgfilter.py \
tests/unit/test_context.py \
tests/unit/test_deprecated.py \
tests/unit/test_excutils.py \
tests/unit/test_funcutils.py \
tests/unit/test_hooks.py \
tests/unit/test_importutils.py \
tests/unit/test_jsonutils.py \
tests/unit/test_local.py \
tests/unit/test_memorycache.py \
tests/unit/test_network_utils.py \
tests/unit/test_policy.py \
tests/unit/test_quota.py \
tests/unit/test_notifier.py \
tests/unit/test_periodic.py \
tests/unit/test_request_utils.py \
tests/unit/test_sslutils.py \
tests/unit/test_systemd.py \
tests/unit/test_timeutils.py \
tests/unit/test_units.py \
tests/unit/test_uuidutils.py \
tests/unit/test_xmlutils.py \
tests/unit/test_versionutils.py
[testenv:pyflakes]
commands = flake8
[hacking]
import_exceptions =
openstack.common.gettextutils
six.moves.mox