Unblock gate failures

There are a few issues causing all gate runs to fail that are addressed
in this patch.

Update constraints to match global requirements:

There are a few local requirements that conflict with what is now in
upstream global-requirements. This updates sphinx to match the
constrained versions due to incompatibility with py2 and uncaps
jsonschema.

Update handling for falcon 2.0.0 behavior changes:

The 2.0.0 release of falcon changed the default values for two request
query parsing options that would cause failures due to unexpected
results. This sets those options to their previous defaults to maintain
compatibility across 2.0.0 and pre-2.0.0 versions of the package.
Lower constraint version raised to 1.1.0 where the options were
introduced.

There are additional integration test failures with Falcon 2.0.0 that
were due to changes in the subscription URL path.

Closes-bug: #1830903

Requirements and upper constraints not enforced in some tox targets:

The docs and api-ref tox targets were not setting the right dependencies
or the upper constraints to use for pip installs. Also updates the
constraints to the newer preferred static redirect URL maintained by the
release team.

Co-authored-by: wanghao <sxmatch1986@gmail.com>
Change-Id: I19c5363878c629a04e1be902c865ee7cea92dcd9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2019-05-28 09:30:09 -05:00
parent d4730fa60b
commit 1af2c91e41
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
7 changed files with 28 additions and 15 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ var/*
ChangeLog ChangeLog
AUTHORS AUTHORS
etc/zaqar.conf.sample etc/zaqar.conf.sample
doc/source/_static/zaqar.conf.sample
.idea .idea
# Files created by releasenotes build # Files created by releasenotes build
releasenotes/build releasenotes/build

View File

@ -2,7 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.3,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.3;python_version>='3.4' # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0

View File

@ -6,7 +6,7 @@ ddt==1.0.1
doc8==0.6.0 doc8==0.6.0
dogpile.cache==0.6.2 dogpile.cache==0.6.2
enum34==1.0.4;python_version=='2.7' enum34==1.0.4;python_version=='2.7'
falcon==1.0.0 falcon==1.1.0
fixtures==3.0.0 fixtures==3.0.0
flake8==2.5.5 flake8==2.5.5
future==0.16.0 future==0.16.0

View File

@ -5,8 +5,8 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
alembic>=0.8.10 # MIT alembic>=0.8.10 # MIT
Babel!=2.4.0,>=2.3.4 # BSD Babel!=2.4.0,>=2.3.4 # BSD
falcon>=1.0.0 # Apache-2.0 falcon>=1.1.0 # Apache-2.0
jsonschema<3.0.0,>=2.6.0 # MIT jsonschema>=2.6.0 # MIT
iso8601>=0.1.11 # MIT iso8601>=0.1.11 # MIT
keystonemiddleware>=4.17.0 # Apache-2.0 keystonemiddleware>=4.17.0 # Apache-2.0
msgpack>=0.5.1 # Apache-2.0 msgpack>=0.5.1 # Apache-2.0

21
tox.ini
View File

@ -14,7 +14,7 @@ setenv = VIRTUAL_ENV={envdir}
OS_STDERR_CAPTURE=1 OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60 OS_TEST_TIMEOUT=60
OS_TEST_PATH=./zaqar/tests/unit OS_TEST_PATH=./zaqar/tests/unit
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = commands =
@ -63,9 +63,10 @@ commands = {posargs}
[testenv:docs] [testenv:docs]
basepython = python3 basepython = python3
deps = deps =
-r{toxinidir}/doc/requirements.txt -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = commands =
sphinx-build -W -b html doc/source doc/build/html sphinx-build -W -b html doc/source doc/build/html
[testenv:api-ref] [testenv:api-ref]
basepython = python3 basepython = python3
@ -74,9 +75,12 @@ basepython = python3
# #
whitelist_externals = bash whitelist_externals = bash
rm rm
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf api-ref/build rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:debug] [testenv:debug]
basepython = python3 basepython = python3
@ -84,9 +88,12 @@ commands = oslo_debug_helper {posargs}
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3 basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = commands =
doc8 releasenotes/source releasenotes/notes doc8 releasenotes/source releasenotes/notes
sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]
exclude = .venv*,.git,.tox,dist,doc,*lib/python*,*.egg,.update-venv exclude = .venv*,.git,.tox,dist,doc,*lib/python*,*.egg,.update-venv

View File

@ -43,7 +43,7 @@ class TestSubscriptions(base.V2FunctionalTestBase):
self.client.put(self.queue_url) self.client.put(self.queue_url)
self.subscriptions_url = self.queue_url + '/subscriptions/' self.subscriptions_url = self.queue_url + '/subscriptions'
self.client.set_base_url(self.subscriptions_url) self.client.set_base_url(self.subscriptions_url)
def tearDown(self): def tearDown(self):
@ -51,7 +51,7 @@ class TestSubscriptions(base.V2FunctionalTestBase):
result = self.client.get(self.subscriptions_url) result = self.client.get(self.subscriptions_url)
subscriptions = result.json()['subscriptions'] subscriptions = result.json()['subscriptions']
for sub in subscriptions: for sub in subscriptions:
sub_url = self.subscriptions_url + sub['id'] sub_url = self.subscriptions_url + '/' + sub['id']
self.client.delete(sub_url) self.client.delete(sub_url)
# Delete test queue. # Delete test queue.
self.client.delete(self.queue_url) self.client.delete(self.queue_url)
@ -72,7 +72,7 @@ class TestSubscriptions(base.V2FunctionalTestBase):
result = self.client.post(data=doc) result = self.client.post(data=doc)
self.assertEqual(201, result.status_code) self.assertEqual(201, result.status_code)
shortlive_id = result.json()['subscription_id'] shortlive_id = result.json()['subscription_id']
shortlive_url = self.subscriptions_url + shortlive_id shortlive_url = self.subscriptions_url + '/' + shortlive_id
# Let's wait for subscription to expire. # Let's wait for subscription to expire.
for i in range(self.class_ttl_gc_interval + ttl_for_shortlive): for i in range(self.class_ttl_gc_interval + ttl_for_shortlive):
@ -97,7 +97,7 @@ class TestSubscriptions(base.V2FunctionalTestBase):
result = self.client.post(data=doc) result = self.client.post(data=doc)
self.assertEqual(201, result.status_code) self.assertEqual(201, result.status_code)
subscription_id = result.json()['subscription_id'] subscription_id = result.json()['subscription_id']
subscription_url = self.subscriptions_url + subscription_id subscription_url = self.subscriptions_url + '/' + subscription_id
# This is a minimum TTL allowed by server. # This is a minimum TTL allowed by server.
updated_ttl = 60 updated_ttl = 60

View File

@ -129,6 +129,10 @@ class Driver(transport.DriverBase):
else: else:
self.app = falcon.API(before=self.before_hooks) self.app = falcon.API(before=self.before_hooks)
# Set options to keep behavior compatible to pre-2.0.0 falcon
self.app.req_options.auto_parse_qs_csv = True
self.app.req_options.keep_blank_qs_values = False
self.app.add_error_handler(Exception, self._error_handler) self.app.add_error_handler(Exception, self._error_handler)
for version_path, endpoints in catalog: for version_path, endpoints in catalog: