Fix pep8 and py27, functional jobs
pyflake8 was updated and not properly constrainted by hacking, update to hacking 3.1.0 and fix the problems found. py27 failed since global upper-constraints includes py3 only packages. Use lower-constraints for this test. The functional jobs run on master with py27, remove the py27 master job, change the jobs so that py3 is used everywhere. Change-Id: I695d60e53857e03f206dcd7cf10c06c76c8d6cc0
This commit is contained in:
parent
0d5c2b5249
commit
08c07018dc
@ -95,19 +95,17 @@
|
|||||||
description: |
|
description: |
|
||||||
Run shade functional tests against a master devstack
|
Run shade functional tests against a master devstack
|
||||||
vars:
|
vars:
|
||||||
python_version: 2.7
|
|
||||||
devstack_localrc:
|
devstack_localrc:
|
||||||
Q_SERVICE_PLUGIN_CLASSES: qos
|
Q_SERVICE_PLUGIN_CLASSES: qos
|
||||||
Q_ML2_PLUGIN_EXT_DRIVERS: qos,port_security
|
Q_ML2_PLUGIN_EXT_DRIVERS: qos,port_security
|
||||||
|
tox_environment:
|
||||||
|
SHADE_TOX_PYTHON: python3
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: shade-functional-devstack-python3
|
name: shade-functional-devstack-python3
|
||||||
parent: shade-functional-devstack
|
parent: shade-functional-devstack
|
||||||
description: |
|
description: |
|
||||||
Run shade functional tests using python3 against a master devstack
|
Run shade functional tests using python3 against a master devstack
|
||||||
vars:
|
|
||||||
shade_environment:
|
|
||||||
SHADE_TOX_PYTHON: python3
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: shade-functional-devstack-tips-python3
|
name: shade-functional-devstack-tips-python3
|
||||||
@ -207,11 +205,9 @@
|
|||||||
- shade-ansible-stable-2.5-functional-devstack:
|
- shade-ansible-stable-2.5-functional-devstack:
|
||||||
voting: false
|
voting: false
|
||||||
- shade-ansible-functional-devstack
|
- shade-ansible-functional-devstack
|
||||||
- shade-functional-devstack
|
|
||||||
- shade-functional-devstack-magnum
|
- shade-functional-devstack-magnum
|
||||||
- shade-functional-devstack-python3
|
- shade-functional-devstack-python3
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- shade-ansible-functional-devstack
|
- shade-ansible-functional-devstack
|
||||||
- shade-functional-devstack
|
|
||||||
- shade-functional-devstack-python3
|
- shade-functional-devstack-python3
|
||||||
|
@ -5102,7 +5102,7 @@ class OpenStackCloud(
|
|||||||
if not img_props:
|
if not img_props:
|
||||||
return False
|
return False
|
||||||
self._image_client.put(
|
self._image_client.put(
|
||||||
'/images/{id}'.format(image.id), headers=img_props)
|
'/images/{id}'.format(id=image.id), headers=img_props)
|
||||||
self.list_images.invalidate(self)
|
self.list_images.invalidate(self)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -11466,7 +11466,7 @@ class OpenStackCloud(
|
|||||||
proj = self.get_project(name_or_id)
|
proj = self.get_project(name_or_id)
|
||||||
if not proj:
|
if not proj:
|
||||||
raise exc.OpenStackCloudException(
|
raise exc.OpenStackCloudException(
|
||||||
"project does not exist: {}".format(name=proj.id))
|
"project does not exist: {name}".format(name=proj.id))
|
||||||
|
|
||||||
data = self._compute_client.get(
|
data = self._compute_client.get(
|
||||||
'/os-simple-tenant-usage/{project}'.format(project=proj.id),
|
'/os-simple-tenant-usage/{project}'.format(project=proj.id),
|
||||||
|
@ -305,7 +305,7 @@ class TestImage(BaseTestImage):
|
|||||||
'X-Timestamp': '1481912480.41664',
|
'X-Timestamp': '1481912480.41664',
|
||||||
'X-Trans-Id': 'tx60ec128d9dbf44b9add68-0058543271dfw1', # noqa
|
'X-Trans-Id': 'tx60ec128d9dbf44b9add68-0058543271dfw1', # noqa
|
||||||
'X-Container-Bytes-Used': '0',
|
'X-Container-Bytes-Used': '0',
|
||||||
'Content-Type': 'text/plain; charset=utf-8'}),
|
'Content-Type': 'text/plain; charset=utf-8'}),
|
||||||
dict(method='HEAD',
|
dict(method='HEAD',
|
||||||
uri='{endpoint}/{container}/{object}'.format(
|
uri='{endpoint}/{container}/{object}'.format(
|
||||||
endpoint=endpoint, container=self.container_name,
|
endpoint=endpoint, container=self.container_name,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Licensed under the Apache License, Version 2.0 (the 'License');
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
|
@ -643,7 +643,6 @@ class TestObjectUploads(BaseTestObject):
|
|||||||
'header mismatch in manifest call')
|
'header mismatch in manifest call')
|
||||||
|
|
||||||
base_object = '/{container}/{object}'.format(
|
base_object = '/{container}/{object}'.format(
|
||||||
endpoint=self.endpoint,
|
|
||||||
container=self.container,
|
container=self.container,
|
||||||
object=self.object)
|
object=self.object)
|
||||||
|
|
||||||
@ -864,7 +863,6 @@ class TestObjectUploads(BaseTestObject):
|
|||||||
'header mismatch in manifest call')
|
'header mismatch in manifest call')
|
||||||
|
|
||||||
base_object = '/{container}/{object}'.format(
|
base_object = '/{container}/{object}'.format(
|
||||||
endpoint=self.endpoint,
|
|
||||||
container=self.container,
|
container=self.container,
|
||||||
object=self.object)
|
object=self.object)
|
||||||
|
|
||||||
|
@ -582,8 +582,7 @@ class TestSecurityGroups(base.RequestsMockTestCase):
|
|||||||
dict(
|
dict(
|
||||||
method='GET',
|
method='GET',
|
||||||
uri='{endpoint}/os-security-groups'.format(
|
uri='{endpoint}/os-security-groups'.format(
|
||||||
endpoint=fakes.COMPUTE_ENDPOINT,
|
endpoint=fakes.COMPUTE_ENDPOINT),
|
||||||
id='server_id'),
|
|
||||||
json={'security_groups': [nova_grp_dict]}),
|
json={'security_groups': [nova_grp_dict]}),
|
||||||
dict(
|
dict(
|
||||||
method='POST',
|
method='POST',
|
||||||
|
@ -225,7 +225,7 @@ class TestStack(base.RequestsMockTestCase):
|
|||||||
dict(method='GET',
|
dict(method='GET',
|
||||||
uri='{endpoint}/stacks/{id}?{resolve}'.format(
|
uri='{endpoint}/stacks/{id}?{resolve}'.format(
|
||||||
endpoint=fakes.ORCHESTRATION_ENDPOINT,
|
endpoint=fakes.ORCHESTRATION_ENDPOINT,
|
||||||
id=self.stack_id, name=self.stack_name, resolve=resolve),
|
id=self.stack_id, resolve=resolve),
|
||||||
status_code=404),
|
status_code=404),
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ class TestStack(base.RequestsMockTestCase):
|
|||||||
dict(method='GET',
|
dict(method='GET',
|
||||||
uri='{endpoint}/stacks/{id}?resolve_outputs=False'.format(
|
uri='{endpoint}/stacks/{id}?resolve_outputs=False'.format(
|
||||||
endpoint=fakes.ORCHESTRATION_ENDPOINT,
|
endpoint=fakes.ORCHESTRATION_ENDPOINT,
|
||||||
id=self.stack_id, name=self.stack_name),
|
id=self.stack_id),
|
||||||
status_code=302,
|
status_code=302,
|
||||||
headers=dict(
|
headers=dict(
|
||||||
location='{endpoint}/stacks/{name}/{id}?{resolve}'.format(
|
location='{endpoint}/stacks/{name}/{id}?{resolve}'.format(
|
||||||
|
15
tox.ini
15
tox.ini
@ -19,8 +19,16 @@ deps =
|
|||||||
commands = stestr run {posargs}
|
commands = stestr run {posargs}
|
||||||
stestr slowest
|
stestr slowest
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
deps =
|
||||||
|
# Upper-constraints does not work with py27 anymore, let's
|
||||||
|
# use lower-constraints for this test.
|
||||||
|
-c{toxinidir}/lower-constraints.txt
|
||||||
|
-r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
basepython = {env:SHADE_TOX_PYTHON:python2}
|
basepython = {env:SHADE_TOX_PYTHON:python3}
|
||||||
passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE
|
passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE
|
||||||
commands = stestr --test-path ./shade/tests/functional run --serial {posargs}
|
commands = stestr --test-path ./shade/tests/functional run --serial {posargs}
|
||||||
stestr slowest
|
stestr slowest
|
||||||
@ -32,7 +40,7 @@ skip_install = True
|
|||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
||||||
doc8
|
doc8
|
||||||
hacking>=2.0,<3
|
hacking>=3.1.0,<3.2.0
|
||||||
pygments
|
pygments
|
||||||
commands =
|
commands =
|
||||||
doc8 doc/source
|
doc8 doc/source
|
||||||
@ -97,7 +105,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
|
|||||||
# H4 Are about docstrings - and there's just too many of them to fix
|
# H4 Are about docstrings - and there's just too many of them to fix
|
||||||
# W503 Is supposed to be off by default but a bug has it on by default. It's
|
# W503 Is supposed to be off by default but a bug has it on by default. It's
|
||||||
# also a categorially terrible idea and Donald Knuth agrees with me.
|
# also a categorially terrible idea and Donald Knuth agrees with me.
|
||||||
ignore = H103,H306,H4,W503,W504
|
# E741 ambiguous variable name 'l'
|
||||||
|
ignore = H103,H306,H4,W503,W504,E741
|
||||||
show-source = True
|
show-source = True
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user