2011-12-30 14:03:15 -08:00
|
|
|
[tox]
|
2016-12-19 14:44:35 -06:00
|
|
|
minversion = 2.3.1
|
2016-12-13 22:04:21 +00:00
|
|
|
envlist = py35,py27,pep8
|
2013-12-03 23:32:07 +11:00
|
|
|
skipsdist = True
|
2011-12-30 14:03:15 -08:00
|
|
|
|
|
|
|
[testenv]
|
2017-06-15 19:37:27 -05:00
|
|
|
# Set default python version
|
|
|
|
basepython = python2.7
|
2016-09-30 17:07:06 +08:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2016-11-14 17:18:34 -06:00
|
|
|
# NOTE(hemanthm): The environment variable "OS_TEST_DBAPI_ADMIN_CONNECTION"
|
|
|
|
# must be set to force oslo.db tests to use a file-based sqlite database
|
|
|
|
# instead of the default in-memory database, which doesn't work well with
|
|
|
|
# alembic migrations. The file-based database pointed by the environment
|
|
|
|
# variable itself is not used for testing. Neither is it ever created. Oslo.db
|
|
|
|
# creates another file-based database for testing purposes and deletes it as a
|
|
|
|
# part of its test clean-up. Think of setting this environment variable as a
|
|
|
|
# clue for oslo.db to use file-based database.
|
|
|
|
OS_TEST_DBAPI_ADMIN_CONNECTION=sqlite:////tmp/placeholder-never-created-nor-used.db
|
2013-12-03 23:32:07 +11:00
|
|
|
usedevelop = True
|
2016-02-21 19:34:11 +01:00
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
2015-09-25 06:52:38 +12:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-12-19 14:44:35 -06:00
|
|
|
commands =
|
2017-06-15 19:37:27 -05:00
|
|
|
find . -type f -name "*.pyc" -delete
|
2014-03-31 22:13:41 +02:00
|
|
|
whitelist_externals = bash
|
2017-06-15 19:37:27 -05:00
|
|
|
find
|
|
|
|
rm
|
2016-04-08 10:35:01 +02:00
|
|
|
passenv = *_proxy *_PROXY
|
2012-06-03 09:54:51 -04:00
|
|
|
|
2017-05-08 10:31:18 +02:00
|
|
|
[testenv:py27]
|
|
|
|
commands = ostestr --slowest {posargs}
|
|
|
|
|
2016-12-13 22:04:21 +00:00
|
|
|
[testenv:py35]
|
2017-06-15 19:37:27 -05:00
|
|
|
basepython = python3.5
|
2017-04-14 00:19:08 +00:00
|
|
|
commands = ostestr --slowest {posargs}
|
2015-06-19 14:16:38 +02:00
|
|
|
|
2017-06-15 19:37:27 -05:00
|
|
|
[testenv:functional]
|
2017-10-09 14:18:51 +08:00
|
|
|
setenv =
|
2017-06-15 19:37:27 -05:00
|
|
|
TEST_PATH = ./glance/tests/functional
|
2017-10-09 14:18:51 +08:00
|
|
|
commands =
|
2017-06-15 19:37:27 -05:00
|
|
|
ostestr {posargs}
|
|
|
|
|
|
|
|
[testenv:functional-py35]
|
|
|
|
basepython = python3.5
|
|
|
|
setenv =
|
|
|
|
TEST_PATH = ./glance/tests/functional
|
|
|
|
commands =
|
|
|
|
ostestr '{posargs}'
|
2017-10-09 14:18:51 +08:00
|
|
|
|
2011-12-30 14:03:15 -08:00
|
|
|
[testenv:pep8]
|
2012-11-09 12:56:25 -05:00
|
|
|
commands =
|
2013-12-03 23:32:07 +11:00
|
|
|
flake8 {posargs}
|
2016-02-21 18:33:40 +01:00
|
|
|
# Run security linter
|
|
|
|
bandit -c bandit.yaml -r glance -n5 -p gate
|
2014-03-31 22:13:41 +02:00
|
|
|
# Check that .po and .pot files are valid:
|
|
|
|
bash -c "find glance -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
2017-11-16 14:55:19 +07:00
|
|
|
doc8 {posargs}
|
2011-12-30 14:03:15 -08:00
|
|
|
|
2014-03-27 17:39:14 +08:00
|
|
|
[testenv:genconfig]
|
|
|
|
commands =
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-api.conf
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-registry.conf
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-scrubber.conf
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-cache.conf
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-manage.conf
|
2017-10-24 16:12:06 +05:30
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-image-import.conf
|
2014-03-27 17:39:14 +08:00
|
|
|
|
WADL to RST migration (part 1)
This brings the Images API Reference to the glance tree as part of
the effort described here:
https://wiki.openstack.org/wiki/Documentation/Migrate#API_Reference_Plan
This patch introduces (a) the tox environment to generate the api-ref,
and (b) the content of the Images v1 API reference converted to RST.
The content has been corrected where I noticed divergences with reality.
Note to reviewers: The conversion project is ongoing, that is, the doc
team is continuing to develop tools (for example, to display the response
codes in a table) and converging on a style for these docs. So this isn't
a final product, there will be more patches later. While this patch is
not perfect, it is pareto-optimal with respect to content (it's at least
as good as the current guide, and better in at least one place). Thus
my advice, should you choose to take it, is that we should merge this
patch to get these docs in-tree, and make improvements as additional
patches that can focus on particular API calls rather than try to get
everything perfect on this patch.
Change-Id: I51dfaf1832108466f115ab183838c5f28e138312
2016-05-03 17:27:58 -04:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2017-05-25 22:36:51 +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, and develop mode disabled
|
|
|
|
# explicitly to avoid unnecessarily installing the checked-out repo too (this
|
|
|
|
# further relies on "tox.skipsdist = True" above).
|
|
|
|
deps = bindep
|
|
|
|
commands = bindep test
|
|
|
|
usedevelop = False
|
|
|
|
|
2017-11-16 14:55:19 +07:00
|
|
|
[doc8]
|
|
|
|
ignore-path = .venv,.git,.tox,*glance/locale*,*lib/python*,glance.egg*,api-ref/build,doc/build,doc/source/contributor/api
|
|
|
|
|
2013-04-20 22:28:31 -07:00
|
|
|
[flake8]
|
2013-06-09 10:46:50 +02:00
|
|
|
# TODO(dmllr): Analyze or fix the warnings blacklisted below
|
|
|
|
# E711 comparison to None should be 'if cond is not None:'
|
|
|
|
# E712 comparison to True should be 'if cond is True:' or 'if cond:'
|
|
|
|
# H404 multi line docstring should start with a summary
|
2014-06-12 15:36:21 +02:00
|
|
|
# H405 multi line docstring summary not separated with an empty line
|
2015-07-16 11:15:30 +08:00
|
|
|
ignore = E711,E712,H404,H405
|
2015-08-31 18:21:24 +02:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,etc,*glance/locale*,*lib/python*,*egg,build
|
2014-05-09 12:33:21 +02:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
local-check-factory = glance.hacking.checks.factory
|
2015-09-29 14:39:41 +03:00
|
|
|
import_exceptions = glance.i18n
|
2017-06-15 19:37:27 -05:00
|
|
|
|
|
|
|
[testenv:docs]
|
|
|
|
commands =
|
|
|
|
rm -fr doc/build
|
|
|
|
python setup.py build_sphinx
|
|
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
commands = bandit -c bandit.yaml -r glance -n5 -p gate
|
|
|
|
|
|
|
|
[testenv:releasenotes]
|
|
|
|
commands =
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
|
|
|
[testenv:cover]
|
|
|
|
setenv =
|
|
|
|
PYTHON=coverage run --source glance --parallel-mode
|
|
|
|
commands =
|
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
|
|
|
|
[testenv:debug]
|
|
|
|
commands =
|
|
|
|
oslo_debug_helper {posargs}
|
|
|
|
|
|
|
|
[testenv:debug-py27]
|
|
|
|
commands =
|
|
|
|
oslo_debug_helper {posargs}
|
|
|
|
|
|
|
|
[testenv:debug-py35]
|
|
|
|
basepython = python3.5
|
|
|
|
commands =
|
|
|
|
oslo_debug_helper {posargs}
|