add py36 jobs and tox target

As part of the python 3 first effort [1], this patch adds UT support for
python 3.6 by:
- Updating the zuul.yaml to include the py36 template and jobs.
- Adding a py36-dev target to tox.ini for local testing.
- Updating the upper constraints to use master rather than stable/rocky.
- Updating the version of eventlet used as previous 2x.x versions had
a python 3 bug for monkey patching.
- Consolidating the eventlet monkey patching in the code.

[1] https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I3c11ac9dff9a2e25b33e8310929c961ffd0bcc52
This commit is contained in:
Boden R 2018-09-27 12:41:08 -06:00
parent 759f015542
commit 822f7c4cf7
7 changed files with 48 additions and 9 deletions

View File

@ -3,6 +3,7 @@
- openstack-python-jobs-neutron - openstack-python-jobs-neutron
- check-requirements - check-requirements
- openstack-python35-jobs-neutron - openstack-python35-jobs-neutron
- openstack-python36-jobs
- periodic-jobs-with-neutron-lib-master - periodic-jobs-with-neutron-lib-master
- build-openstack-docs-pti - build-openstack-docs-pti
check: check:
@ -46,6 +47,19 @@
- openstack/neutron-vpnaas - openstack/neutron-vpnaas
- openstack/tap-as-a-service - openstack/tap-as-a-service
- openstack/octavia - openstack/octavia
- openstack-tox-py36:
timeout: 5400
required-projects:
- openstack/neutron
- openstack/networking-l2gw
- openstack/networking-sfc
- openstack/neutron-lbaas
- openstack/vmware-nsxlib
- openstack/neutron-fwaas
- openstack/neutron-dynamic-routing
- openstack/neutron-vpnaas
- openstack/tap-as-a-service
- openstack/octavia
gate: gate:
queue: vmware-nsx queue: vmware-nsx
jobs: jobs:
@ -88,6 +102,19 @@
- openstack/neutron-vpnaas - openstack/neutron-vpnaas
- openstack/tap-as-a-service - openstack/tap-as-a-service
- openstack/octavia - openstack/octavia
- openstack-tox-py36:
timeout: 5400
required-projects:
- openstack/neutron
- openstack/networking-l2gw
- openstack/networking-sfc
- openstack/neutron-lbaas
- openstack/vmware-nsxlib
- openstack/neutron-fwaas
- openstack/neutron-dynamic-routing
- openstack/neutron-vpnaas
- openstack/tap-as-a-service
- openstack/octavia
post: post:
jobs: jobs:
- publish-openstack-python-branch-tarball: - publish-openstack-python-branch-tarball:

View File

@ -19,7 +19,7 @@ deprecation==1.0
docutils==0.11 docutils==0.11
dogpile.cache==0.6.2 dogpile.cache==0.6.2
dulwich==0.15.0 dulwich==0.15.0
eventlet==0.18.2 eventlet==0.24.1
extras==1.0.0 extras==1.0.0
fasteners==0.7.0 fasteners==0.7.0
fixtures==3.0.0 fixtures==3.0.0

View File

@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0 pbr!=2.1.0,>=2.0.0 # Apache-2.0
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT eventlet>=0.24.1 # MIT
httplib2>=0.9.1 # MIT httplib2>=0.9.1 # MIT
netaddr>=0.7.18 # BSD netaddr>=0.7.18 # BSD
tenacity>=4.4.0 # Apache-2.0 tenacity>=4.4.0 # Apache-2.0

17
tox.ini
View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py35,py27,pep8,docs envlist = py35,py36,py27,pep8,docs
minversion = 1.6 minversion = 1.6
skipsdist = True skipsdist = True
@ -8,7 +8,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning PYTHONWARNINGS=default::DeprecationWarning
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
usedevelop = True usedevelop = True
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
whitelist_externals = whitelist_externals =
@ -70,9 +70,11 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/re
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:py27] [testenv:py27]
basepython = python2.7
setenv = OS_FAIL_ON_MISSING_DEPS=1 setenv = OS_FAIL_ON_MISSING_DEPS=1
[testenv:py36] [testenv:py36]
basepython = python3.6
setenv = OS_FAIL_ON_MISSING_DEPS=1 setenv = OS_FAIL_ON_MISSING_DEPS=1
[testenv:py27-dev] [testenv:py27-dev]
@ -84,7 +86,16 @@ whitelist_externals =
stestr stestr
[testenv:py3-dev] [testenv:py3-dev]
basepython = python3 basepython = python3.5
commands =
{[testenv:dev]commands}
pip freeze
stestr run {posargs}
whitelist_externals =
stestr
[testenv:py36-dev]
basepython = python3.6
commands = commands =
{[testenv:dev]commands} {[testenv:dev]commands}
pip freeze pip freeze

View File

@ -10,7 +10,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.common import eventlet_utils
import os eventlet_utils.monkey_patch()
import os # noqa
NSX_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions') NSX_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions')

View File

@ -23,7 +23,7 @@ from vmware_nsx.api_client import base
from vmware_nsx.api_client import eventlet_request from vmware_nsx.api_client import eventlet_request
import eventlet import eventlet
eventlet.monkey_patch()
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -17,7 +17,6 @@
import os import os
import time import time
import eventlet
import mock import mock
from vmware_nsx.api_client import client as nsx_client from vmware_nsx.api_client import client as nsx_client
@ -51,7 +50,6 @@ EDGE_MANAGE_NAME = '%s.%s' % (edge_manage_class.__module__,
edge_manage_class.__name__) edge_manage_class.__name__)
# Mock for the tenacity retrying sleeping method # Mock for the tenacity retrying sleeping method
eventlet.monkey_patch()
mocked_retry_sleep = mock.patch.object(time, 'sleep') mocked_retry_sleep = mock.patch.object(time, 'sleep')
mocked_retry_sleep.start() mocked_retry_sleep.start()