97 lines
2.8 KiB
INI
97 lines
2.8 KiB
INI
[tox]
|
|
minversion = 1.6
|
|
envlist = py27,pep8
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
NOSE_WITH_COVERAGE=1
|
|
NOSE_COVER_BRANCHES=1
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
git+git://github.com/openstack/swift.git@2.7.0
|
|
commands =
|
|
find . -type f -name "*.py[c|o]" -delete
|
|
find . -type d -name "__pycache__" -delete
|
|
nosetests {posargs:tests/unit} -v
|
|
|
|
whitelist_externals = bash
|
|
find
|
|
rm
|
|
|
|
[testenv:pep8python]
|
|
commands =
|
|
flake8
|
|
flake8 --filename=* Engine/agent/bin
|
|
|
|
[testenv:py34]
|
|
commands =
|
|
nosetests -v \
|
|
tests/unit/swift/storlet_gateway
|
|
|
|
[testenv:py35]
|
|
commands = {[testenv:py34]commands}
|
|
|
|
[testenv:func]
|
|
commands = ./.functests jenkins
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
commands = python setup.py test --coverage --testr-args='{posargs}'
|
|
|
|
[testenv:docs]
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:bashate]
|
|
commands =
|
|
# Run bashate check for all bash scripts
|
|
# Ignores the following rules:
|
|
# E003: Indent not multiple of 4 (we prefer to use multiples of 2)
|
|
# E006: Line longer than 79 columns (as many scripts use jinja
|
|
# templating, this is very difficult)
|
|
# E040: Syntax error determined using `bash -n` (as many scripts
|
|
# use jinja templating, this will often fail and the syntax
|
|
# error will be discovered in execution anyway)
|
|
bash -c "grep --recursive --binary-files=without-match \
|
|
--files-with-match '^.!.*\(ba\)\?sh$' \
|
|
--exclude-dir .tox \
|
|
--exclude-dir .git \
|
|
{toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006,E040"
|
|
|
|
[testenv:ansible-lint]
|
|
commands =
|
|
# Perform an Ansible lint check
|
|
# Ignores the following rules:
|
|
# ANSIBLE0011: All tasks should be named
|
|
# ANSIBLE0012: Commands should not change things if nothing needs doing
|
|
# ANSIBLE0013: Use shell only when shell functionality is required
|
|
bash -c "ansible-lint -x ANSIBLE0011,ANSIBLE0012,ANSIBLE0013 \
|
|
{toxinidir}/install/*/*.yml"
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
# H301: one import per line
|
|
# H306: imports not in alphabetical order (time, os)
|
|
# H401: docstring should not start with a space
|
|
# H403: multi line docstrings should end on a new line
|
|
# H404: multi line docstring should start without a leading new line
|
|
# H405: multi line docstring summary not separated with an empty line
|
|
ignore = E123,E125,H301,H306,H401,H403,H404,H405
|
|
show-source = True
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
{[testenv:pep8python]commands}
|
|
{[testenv:bashate]commands}
|
|
{[testenv:ansible-lint]commands}
|