keystone/tox.ini
2016-01-21 22:34:25 +00:00

164 lines
5.8 KiB
INI

[tox]
minversion = 1.6
skipsdist = True
envlist = py34,py27,linters,docs,genconfig,releasenotes
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
.[ldap,memcache,mongodb]
commands = bash tools/pretty_tox.sh '{posargs}'
whitelist_externals = bash
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
[testenv:py34]
deps = -r{toxinidir}/test-requirements.txt
nose
.[memcache,mongodb]
commands =
nosetests --with-coverage --cover-package=keystone \
keystone/tests/unit/auth/ \
keystone/tests/unit/backend/core_sql.py \
keystone/tests/unit/backend/domain_config/ \
keystone/tests/unit/backend/role/test_sql.py \
keystone/tests/unit/catalog/ \
keystone/tests/unit/common/test_authorization.py \
keystone/tests/unit/common/test_injection.py \
keystone/tests/unit/common/test_json_home.py \
keystone/tests/unit/common/test_manager.py \
keystone/tests/unit/common/test_sql_core.py \
keystone/tests/unit/common/test_utils.py \
keystone/tests/unit/contrib/ \
keystone/tests/unit/external/ \
keystone/tests/unit/test_auth_plugin.py \
keystone/tests/unit/test_backend_endpoint_policy.py \
keystone/tests/unit/test_backend_endpoint_policy_sql.py \
keystone/tests/unit/test_backend_federation_sql.py \
keystone/tests/unit/test_backend_id_mapping_sql.py \
keystone/tests/unit/test_backend.py \
keystone/tests/unit/test_backend_rules.py \
keystone/tests/unit/test_backend_sql.py \
keystone/tests/unit/test_cli.py \
keystone/tests/unit/test_config.py \
keystone/tests/unit/test_contrib_ec2.py \
keystone/tests/unit/test_contrib_s3_core.py \
keystone/tests/unit/test_driver_hints.py \
keystone/tests/unit/test_exception.py \
keystone/tests/unit/test_ipv6.py \
keystone/tests/unit/test_kvs.py \
keystone/tests/unit/test_no_admin_token_auth.py \
keystone/tests/unit/test_policy.py \
keystone/tests/unit/test_revoke.py \
keystone/tests/unit/test_singular_plural.py \
keystone/tests/unit/test_sql_livetest.py \
keystone/tests/unit/test_sql_upgrade.py \
keystone/tests/unit/test_ssl.py \
keystone/tests/unit/test_token_bind.py \
keystone/tests/unit/test_token_provider.py \
keystone/tests/unit/test_url_middleware.py \
keystone/tests/unit/test_v2_controller.py \
keystone/tests/unit/test_validation.py \
keystone/tests/unit/test_wsgi.py \
keystone/tests/unit/tests/ \
keystone/tests/unit/token/test_pki_provider.py \
keystone/tests/unit/token/test_pkiz_provider.py \
keystone/tests/unit/token/test_provider.py \
keystone/tests/unit/token/test_token_model.py \
keystone/tests/unit/token/test_uuid_provider.py
[testenv:legacy_drivers]
deps = -r{toxinidir}/test-requirements.txt
nose
.[ldap,memcache,mongodb]
commands =
# Run each legacy test separately, to avoid SQL model redefinitions
nosetests -v \
keystone/tests/unit/backend/legacy_drivers/assignment/V8/sql.py
nosetests -v \
keystone/tests/unit/backend/legacy_drivers/role/V8/sql.py
nosetests -v \
keystone/tests/unit/backend/legacy_drivers/federation/V8/api_v3.py
nosetests -v \
keystone/tests/unit/backend/legacy_drivers/resource/V8/sql.py
[testenv:linters]
deps =
.[bandit]
{[testenv]deps}
commands =
flake8
# Run bash8 during linters runs to ensure violations are caught by
# the check and gate queues
bashate examples/pki/gen_pki.sh
# Check that .po and .pot files are valid.
bash -c "find keystone -type f -regex '.*\.pot?' -print0| \
xargs -0 -n 1 msgfmt --check-format -o /dev/null"
# Run security linter
bandit -c bandit.yaml -r keystone -n5 -p gate
[testenv:pep8]
# Previous name of linters target, kept for compatability. The infra jobs
# will run the linters job.
deps = {[testenv:linters]deps}
whitelist_externals =
{[testenv]whitelist_externals}
echo
commands = {[testenv:linters]commands}
echo "Use tox -e linters instead"
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:functional]
basepython = python3.4
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH=./keystone/tests/functional
commands = python setup.py testr --slowest --testr-args='{posargs}'
[flake8]
filename= *.py,keystone-all,keystone-manage
show-source = true
# H405: multi line docstring summary not separated with an empty line
# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D105: Missing docstring in magic method
# D202: No blank lines allowed after docstring.
# D203: 1 blank required before class docstring.
# D205: Blank line required between one-line summary and description.
# D400: First line should end with a period.
# D401: First line should be in imperative mood.
ignore = H405,D100,D101,D102,D103,D104,D105,D203,D205,D400,D401
exclude=.venv,.git,.tox,build,dist,doc,*openstack/common*,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity=24
[testenv:docs]
commands=
bash -c "rm -rf doc/build"
bash -c "rm -rf doc/source/api"
python setup.py build_sphinx
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:genconfig]
commands = oslo-config-generator --config-file=config-generator/keystone.conf
[hacking]
import_exceptions =
keystone.i18n
six.moves
local-check-factory = keystone.tests.hacking.checks.factory