2012-01-31 15:27:29 -08:00
|
|
|
[tox]
|
2016-12-14 06:25:54 +00:00
|
|
|
envlist = py35,py27,pep8
|
2018-11-02 11:39:38 +05:30
|
|
|
minversion = 2.3.2
|
2013-12-09 13:56:10 +00:00
|
|
|
skipsdist = True
|
2012-01-31 15:27:29 -08:00
|
|
|
|
|
|
|
[testenv]
|
2013-12-09 13:56:10 +00:00
|
|
|
usedevelop = True
|
2016-11-24 11:46:19 +00:00
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
|
2012-06-08 19:59:26 -04:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2013-06-02 21:28:56 -04:00
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
2012-01-31 15:27:29 -08:00
|
|
|
deps =
|
2013-05-29 22:03:40 +08:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-12-07 21:45:43 +05:30
|
|
|
commands = find . -type f -name "*.py[c|o]" -delete
|
|
|
|
find . -type d -name "__pycache__" -delete
|
|
|
|
nosetests {posargs:test/unit}
|
|
|
|
whitelist_externals = find
|
2016-08-17 17:20:21 +01:00
|
|
|
rm
|
2015-06-02 19:51:39 +00:00
|
|
|
passenv = SWIFT_* *_proxy
|
2012-06-08 19:59:26 -04:00
|
|
|
|
2013-09-04 22:25:28 -04:00
|
|
|
[testenv:cover]
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
|
|
|
NOSE_COVER_HTML=1
|
|
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
|
|
|
|
2018-12-18 21:35:22 -06:00
|
|
|
# Since the practice demonstrated that developers keep adding py2-specific
|
|
|
|
# code inadvertedly, we instituted a practice of "py3 ratchet": we convert
|
|
|
|
# tests file by file, add them into the list below, and never go back.
|
|
|
|
# This list also serves as a shared task board for those helping with py3.
|
|
|
|
# But mind that reviews expanding this list may be outstanding in Gerrit.
|
2018-04-10 17:00:54 -07:00
|
|
|
[testenv:py35]
|
2015-08-27 01:09:41 +02:00
|
|
|
commands =
|
2018-04-10 17:00:54 -07:00
|
|
|
nosetests {posargs:\
|
2018-10-23 00:57:50 -05:00
|
|
|
test/unit/account \
|
2018-02-22 22:48:55 +00:00
|
|
|
test/unit/cli/test_dispersion_report.py \
|
2018-03-13 06:19:44 +00:00
|
|
|
test/unit/cli/test_form_signature.py \
|
2018-02-22 22:48:55 +00:00
|
|
|
test/unit/cli/test_info.py \
|
2018-03-09 00:24:43 +00:00
|
|
|
test/unit/cli/test_recon.py \
|
2018-02-22 22:48:55 +00:00
|
|
|
test/unit/cli/test_relinker.py \
|
2016-11-23 10:14:21 -08:00
|
|
|
test/unit/cli/test_ring_builder_analyzer.py \
|
|
|
|
test/unit/cli/test_ringbuilder.py \
|
2018-12-01 03:25:21 +01:00
|
|
|
test/unit/cli/test_ringcomposer.py \
|
2018-09-10 16:34:50 -06:00
|
|
|
test/unit/common/middleware/crypto \
|
2018-11-07 17:35:23 -06:00
|
|
|
test/unit/common/middleware/test_account_quotas.py \
|
2018-12-03 13:00:13 +01:00
|
|
|
test/unit/common/middleware/test_acl.py \
|
2018-06-21 17:23:41 -07:00
|
|
|
test/unit/common/middleware/test_catch_errors.py \
|
2018-11-07 17:35:23 -06:00
|
|
|
test/unit/common/middleware/test_cname_lookup.py \
|
|
|
|
test/unit/common/middleware/test_container_sync.py \
|
2018-06-22 15:59:03 -07:00
|
|
|
test/unit/common/middleware/test_crossdomain.py \
|
2018-06-22 16:09:26 -07:00
|
|
|
test/unit/common/middleware/test_domain_remap.py \
|
2018-04-19 17:31:04 -07:00
|
|
|
test/unit/common/middleware/test_gatekeeper.py \
|
2018-06-22 15:50:31 -07:00
|
|
|
test/unit/common/middleware/test_healthcheck.py \
|
2018-12-03 13:00:13 +01:00
|
|
|
test/unit/common/middleware/test_keystoneauth.py \
|
2018-06-22 17:49:43 -07:00
|
|
|
test/unit/common/middleware/test_list_endpoints.py \
|
2018-08-31 17:40:48 +00:00
|
|
|
test/unit/common/middleware/test_listing_formats.py \
|
2018-12-03 12:52:00 +01:00
|
|
|
test/unit/common/middleware/test_memcache.py \
|
2018-06-21 17:18:42 -07:00
|
|
|
test/unit/common/middleware/test_proxy_logging.py \
|
2018-12-03 13:00:13 +01:00
|
|
|
test/unit/common/middleware/test_subrequest_logging.py \
|
2018-09-17 15:22:55 -07:00
|
|
|
test/unit/common/middleware/test_tempauth.py \
|
2018-12-02 05:22:14 +01:00
|
|
|
test/unit/common/middleware/test_xprofile.py \
|
2016-11-23 10:14:21 -08:00
|
|
|
test/unit/common/ring \
|
2018-09-15 00:47:35 -06:00
|
|
|
test/unit/common/test_base_storage_server.py \
|
2018-03-01 00:29:24 +00:00
|
|
|
test/unit/common/test_bufferedhttp.py \
|
2018-06-20 15:45:50 -07:00
|
|
|
test/unit/common/test_constraints.py \
|
2019-01-29 03:19:35 +01:00
|
|
|
test/unit/common/test_container_sync_realms.py \
|
2018-11-07 17:35:23 -06:00
|
|
|
test/unit/common/test_daemon.py \
|
2018-07-11 17:55:48 -05:00
|
|
|
test/unit/common/test_db.py \
|
2018-10-22 21:41:23 -05:00
|
|
|
test/unit/common/test_db_replicator.py \
|
2018-09-14 16:32:16 -06:00
|
|
|
test/unit/common/test_direct_client.py \
|
2016-08-22 10:44:43 +02:00
|
|
|
test/unit/common/test_exceptions.py \
|
2016-07-28 13:31:47 +00:00
|
|
|
test/unit/common/test_header_key_dict.py \
|
2018-09-15 00:45:00 -06:00
|
|
|
test/unit/common/test_internal_client.py \
|
2016-11-23 10:14:21 -08:00
|
|
|
test/unit/common/test_linkat.py \
|
2016-07-27 12:16:26 +00:00
|
|
|
test/unit/common/test_manager.py \
|
2018-09-15 00:47:35 -06:00
|
|
|
test/unit/common/test_memcached.py \
|
2018-09-15 01:33:34 -06:00
|
|
|
test/unit/common/test_request_helpers.py \
|
2016-11-23 10:14:21 -08:00
|
|
|
test/unit/common/test_splice.py \
|
2018-02-01 14:30:19 -08:00
|
|
|
test/unit/common/test_storage_policy.py \
|
2018-06-20 16:50:51 -07:00
|
|
|
test/unit/common/test_swob.py \
|
2018-02-01 15:25:53 -08:00
|
|
|
test/unit/common/test_utils.py \
|
2018-06-27 17:11:17 -07:00
|
|
|
test/unit/common/test_wsgi.py \
|
2018-12-03 13:00:13 +01:00
|
|
|
test/unit/container/test_auditor.py \
|
2018-11-01 00:43:41 +00:00
|
|
|
test/unit/container/test_replicator.py \
|
2018-12-03 13:00:13 +01:00
|
|
|
test/unit/container/test_sync_store.py \
|
2018-11-29 01:31:13 -06:00
|
|
|
test/unit/obj/test_server.py \
|
2018-06-27 17:11:17 -07:00
|
|
|
test/unit/proxy/controllers/test_info.py}
|
2016-07-05 10:24:02 -07:00
|
|
|
|
2018-06-20 15:44:26 -07:00
|
|
|
[testenv:py36]
|
|
|
|
commands = {[testenv:py35]commands}
|
|
|
|
|
2012-01-31 15:27:29 -08:00
|
|
|
[testenv:pep8]
|
2016-02-06 16:59:57 +05:30
|
|
|
basepython = python2.7
|
2012-05-03 18:33:05 -07:00
|
|
|
commands =
|
2016-03-08 10:57:56 -06:00
|
|
|
flake8 {posargs:swift test doc setup.py}
|
2013-04-28 18:32:12 -07:00
|
|
|
flake8 --filename=swift* bin
|
2016-09-02 15:00:00 +02:00
|
|
|
bandit -c bandit.yaml -r swift -n 5
|
2018-09-14 17:44:38 -06:00
|
|
|
./.manpages {posargs}
|
2012-01-31 15:27:29 -08:00
|
|
|
|
2014-05-16 14:44:18 -04:00
|
|
|
[testenv:py3pep8]
|
|
|
|
basepython = python3
|
|
|
|
install_command = echo {packages}
|
2016-11-08 15:31:33 +00:00
|
|
|
whitelist_externals = echo
|
2014-05-16 14:44:18 -04:00
|
|
|
commands =
|
|
|
|
# Gross hack. There's no other way to get it to /not/ install swift itself
|
|
|
|
# (which triggers installing eventlet) but also get flake8 installed.
|
|
|
|
pip install flake8
|
2016-03-08 10:57:56 -06:00
|
|
|
flake8 swift test doc setup.py
|
2014-05-16 14:44:18 -04:00
|
|
|
flake8 --filename=swift* bin
|
2018-05-30 07:40:38 -07:00
|
|
|
python ./setup.py check --restructuredtext --strict
|
2018-09-14 17:44:38 -06:00
|
|
|
./.manpages {posargs}
|
2014-05-16 14:44:18 -04:00
|
|
|
|
In-process swift server for functional tests
Provide a way to run the functional tests using a p/a/c/o server setup
in the same process running the nosetests infrastructure.
By setting the environment variable, SWIFT_TEST_IN_PROCESS, to a true
value, the functional test framework will construct a set of proxy,
account, container and object servers running in the same process that
is running the functional tests, ignoring any external swift
service. This in-process swift environment is akin to the one used in
test/unit/proxy/test_server.py.
Setting that same environment variable to a false value will ensure the
in-process servers are not used.
When the above environment variable is not present, and the
/etc/swift/test.conf is _not_ present (or present but empty) on the
system where the functional tests are executing, the in-process
environment will be used. Previously, if no /etc/swift/test.conf file
was found, the tests would just be marked as skipped.
Using this in-process method allows one to gather code coverage using
the functional tests to exercise code paths, in addition to the unit
tests, or more easily debug existing functional tests, or even write new
ones.
There are two constraints that are changed for use with the in-process
functional tests: max_file_size is lowered to roughly 8 MB, and
client_timeout is set to 4s.
Change-Id: I5acd65e3068868d6509feae1d1954237d37fad45
2014-01-11 00:18:04 -05:00
|
|
|
[testenv:func]
|
2016-11-08 15:31:33 +00:00
|
|
|
basepython = python2.7
|
2015-08-07 18:14:13 -05:00
|
|
|
commands = ./.functests {posargs}
|
In-process swift server for functional tests
Provide a way to run the functional tests using a p/a/c/o server setup
in the same process running the nosetests infrastructure.
By setting the environment variable, SWIFT_TEST_IN_PROCESS, to a true
value, the functional test framework will construct a set of proxy,
account, container and object servers running in the same process that
is running the functional tests, ignoring any external swift
service. This in-process swift environment is akin to the one used in
test/unit/proxy/test_server.py.
Setting that same environment variable to a false value will ensure the
in-process servers are not used.
When the above environment variable is not present, and the
/etc/swift/test.conf is _not_ present (or present but empty) on the
system where the functional tests are executing, the in-process
environment will be used. Previously, if no /etc/swift/test.conf file
was found, the tests would just be marked as skipped.
Using this in-process method allows one to gather code coverage using
the functional tests to exercise code paths, in addition to the unit
tests, or more easily debug existing functional tests, or even write new
ones.
There are two constraints that are changed for use with the in-process
functional tests: max_file_size is lowered to roughly 8 MB, and
client_timeout is set to 4s.
Change-Id: I5acd65e3068868d6509feae1d1954237d37fad45
2014-01-11 00:18:04 -05:00
|
|
|
|
2016-11-19 23:24:30 +01:00
|
|
|
[testenv:func-encryption]
|
2016-07-25 22:07:15 -05:00
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption
|
|
|
|
|
2017-02-25 18:50:50 +01:00
|
|
|
[testenv:func-domain-remap-staticweb]
|
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=domain_remap_staticweb
|
|
|
|
|
2017-03-07 19:22:01 +00:00
|
|
|
[testenv:func-ec]
|
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec
|
|
|
|
|
2017-10-16 21:39:12 +09:00
|
|
|
[testenv:func-s3api]
|
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=s3api
|
|
|
|
|
2012-03-16 01:23:39 -07:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2013-04-28 18:32:12 -07:00
|
|
|
|
2014-08-05 00:59:54 -04:00
|
|
|
[testenv:docs]
|
2016-11-08 15:31:33 +00:00
|
|
|
basepython = python2.7
|
2018-03-11 16:27:28 +00:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
|
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
2014-08-05 00:59:54 -04:00
|
|
|
|
2016-05-04 02:00:53 +00:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
2016-11-08 15:31:33 +00:00
|
|
|
basepython = python2.7
|
2018-03-11 16:27:28 +00:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2016-05-04 02:00:53 +00:00
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2015-06-27 23:26:47 +05:30
|
|
|
[testenv:bandit]
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-09-02 09:52:17 -07:00
|
|
|
commands = bandit -c bandit.yaml -r swift -n 5
|
2015-06-27 23:26:47 +05:30
|
|
|
|
2013-04-28 18:32:12 -07:00
|
|
|
[flake8]
|
2015-07-27 11:34:07 +02:00
|
|
|
# it's not a bug that we aren't using all of hacking, ignore:
|
|
|
|
# H101: Use TODO(NAME)
|
|
|
|
# H202: assertRaises Exception too broad
|
|
|
|
# H301: one import per line
|
|
|
|
# H306: imports not in alphabetical order (time, os)
|
|
|
|
# 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
|
2017-01-04 16:21:06 +00:00
|
|
|
ignore = H101,H202,H301,H306,H404,H405,H501
|
2016-03-04 15:19:39 -06:00
|
|
|
exclude = .venv,.tox,dist,*egg
|
2016-07-07 17:58:58 +00:00
|
|
|
filename = *.py,bin/*
|
2013-04-28 18:32:12 -07:00
|
|
|
show-source = True
|
2016-03-28 18:21:22 +02:00
|
|
|
|
|
|
|
[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.
|
2018-09-14 17:44:38 -06:00
|
|
|
skip_install = True
|
2016-03-28 18:21:22 +02:00
|
|
|
deps = bindep
|
|
|
|
commands = bindep test
|
2016-10-03 17:18:22 -07:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
2018-03-11 16:27:28 +00:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2016-10-03 17:18:22 -07:00
|
|
|
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2018-03-22 18:54:29 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
# FIXME(dhellmann): We'll want to uncomment this
|
|
|
|
# when the full test suite works with python 3.
|
|
|
|
# basepython = python3
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|