b3efa1465c
Following PyCQA/astroid@206d8a2 we sarted getting a whole bunch of errors like E:266,44: Value 'headers' doesn't support membership test and E:267,25: Value 'headers' is unsubscriptable Digging around a bit, apparently astroid thinks the headers returned from call_app will always be None -- I guess it doesn't like our use of a list to work around py2's lack of `nonlocal`. By using a proper object to encapsulate state, we can shut up those "error"s. Also, pin upper-constraints to pike for keystone-related jobs. Change-Id: I5ff21260872f4089b030cd94e494dc346ae74b8e
124 lines
3.9 KiB
INI
124 lines
3.9 KiB
INI
[tox]
|
|
envlist = py27,tempauth,keystone,s3acl,pylint,pep8
|
|
minversion = 1.6
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
whitelist_externals =/bin/bash
|
|
usedevelop = True
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} -U {opts} {packages}
|
|
# swift stable/pike (about 2.15.1) from openstack.org
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
http://tarballs.openstack.org/swift/swift-stable-pike.tar.gz
|
|
commands = nosetests {posargs:swift3/test/unit}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
NOSE_WITH_OPENSTACK=1
|
|
NOSE_OPENSTACK_COLOR=1
|
|
NOSE_OPENSTACK_RED=0.05
|
|
NOSE_OPENSTACK_YELLOW=0.025
|
|
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
|
NOSE_OPENSTACK_STDOUT=1
|
|
NOSE_WITH_COVERAGE=1
|
|
NOSE_COVER_BRANCHES=1
|
|
LOG_DEST={envdir}/log
|
|
|
|
[testenv:tempauth]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv]setenv}
|
|
AUTH=tempauth
|
|
|
|
[testenv:keystone]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv]setenv}
|
|
AUTH=keystone
|
|
UPPER_CONSTRAINTS_FILE=https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike
|
|
# keystone 12.0.0 (pike) from openstack.org
|
|
deps =
|
|
{[testenv]deps}
|
|
http://tarballs.openstack.org/keystone/keystone-12.0.0.tar.gz
|
|
|
|
[testenv:s3acl]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv]setenv}
|
|
AUTH=tempauth
|
|
S3ACL=true
|
|
|
|
[testenv:s3acl_master]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv]setenv}
|
|
AUTH=tempauth
|
|
S3ACL=true
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
git+git://github.com/openstack/swift.git
|
|
|
|
[testenv:s3tests_tempauth]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv]setenv}
|
|
AUTH=tempauth
|
|
S3ACL=true
|
|
DNS_BUCKET_NAMES=false
|
|
CHECK_BUCKET_OWNER=true
|
|
CEPH_TESTS=1
|
|
|
|
[testenv:s3tests_keystone]
|
|
commands = /bin/bash {posargs:swift3/test/functional/run_test.sh}
|
|
setenv = {[testenv:keystone]setenv}
|
|
S3ACL=true
|
|
DNS_BUCKET_NAMES=false
|
|
CHECK_BUCKET_OWNER=true
|
|
CEPH_TESTS=1
|
|
deps =
|
|
{[testenv:keystone]deps}
|
|
|
|
[testenv:pylint]
|
|
# Avoid to fail by checking members at lxml dynamically loaded module
|
|
commands = pylint -E swift3 --ignored-modules=lxml.etree
|
|
setenv = {[testenv]setenv}
|
|
# bypass constraints; pylint requires a later astroid
|
|
CONSTRAINTS_FILE=
|
|
|
|
[testenv:pep8]
|
|
commands = flake8
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv = {[testenv]setenv}
|
|
NOSE_COVER_HTML=1
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
|
|
|
[flake8]
|
|
# follow the same style guidelines with swift
|
|
# F812: list comprehension redefines ...
|
|
# H101: Use TODO(NAME)
|
|
# H202: assertRaises Exception too broad
|
|
# H233: Python 3.x incompatible use of print operator
|
|
# H237: module ... is removed in Python 3
|
|
# 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
|
|
# H501: Do not use self.__dict__ for string formatting
|
|
ignore = F812,H101,H202,H233,H237,H301,H306,H401,H403,H404,H405,H501
|
|
exclude = .venv,.git,.tox,dist,doc,*egg,build,scratch
|
|
show-source = True
|
|
# Add in some optional checks:
|
|
# H203: Use assertIs(Not)None to check for None
|
|
enable-extensions = H203
|
|
|
|
|
|
[testenv:bindep]
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
# separately, outside of the requirements files.
|
|
usedevelop = False
|
|
skip_install = True
|
|
deps = bindep
|
|
commands = bindep test
|