Fix py35 and pypy tox env

The basepython line was causing the py35 tests to actually run under
python2. Whoops.

It was doing the same to pypy. Add pypy to bindep with the pypy tag.
Cryptography and the version of pypi in xenial are incompatible, so
update the pypy job to run on fedora-26 instead, which has a new enough
pypy.

Shift the line so that it only applies to functional and ansible tests,
since that's where it's used.

Depends-On: I7c22e23b73ddfc18ee28e87d34d1988417b49ccb
Change-Id: Ia27a0aa0633dcf48c1bab06b3c803f996eae9efa
This commit is contained in:
Monty Taylor 2017-11-28 04:35:25 -06:00
parent eb9d3a5a46
commit 7fb95b9e75
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
5 changed files with 16 additions and 4 deletions

View File

@ -196,16 +196,19 @@
- project:
name: openstack/python-openstacksdk
templates:
- openstack-pypy-jobs
- openstacksdk-functional-tips
- openstacksdk-tox-tips
check:
jobs:
- openstack-tox-pypy:
nodeset: fedora-26
- openstacksdk-functional-devstack
- openstacksdk-functional-devstack-magnum:
voting: false
- openstacksdk-functional-devstack-python3
gate:
jobs:
- openstack-tox-pypy:
nodeset: fedora-26
- openstacksdk-functional-devstack
- openstacksdk-functional-devstack-python3

View File

@ -6,3 +6,7 @@ python-dev [platform:dpkg]
python-devel [platform:rpm]
libffi-dev [platform:dpkg]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
pypy [pypy]
pypy-dev [platform:dpkg pypy]
pypy-devel [platform:rpm pypy]

View File

@ -376,7 +376,8 @@ class TestCreateServer(base.RequestsMockTestCase):
Test that a server passed user-data sends it base64 encoded.
"""
user_data = self.getUniqueString('user_data')
user_data_b64 = base64.b64encode(user_data).decode('utf-8')
user_data_b64 = base64.b64encode(
user_data.encode('utf-8')).decode('utf-8')
fake_server = fakes.make_fake_server('1234', '', 'BUILD')
fake_server['user_data'] = user_data

View File

@ -1307,8 +1307,10 @@ class TestResourceFind(base.TestCase):
@classmethod
def existing(cls, **kwargs):
response = mock.Mock()
response.status_code = 404
raise exceptions.NotFoundException(
'Not Found', response=mock.Mock())
'Not Found', response=response)
@classmethod
def list(cls, session):
@ -1485,6 +1487,7 @@ class TestWaitForDelete(base.TestCase):
def test_success(self, mock_sleep):
response = mock.Mock()
response.headers = {}
response.status_code = 404
resource = mock.Mock()
resource.get.side_effect = [
None, None,

View File

@ -5,7 +5,6 @@ skipsdist = True
[testenv]
usedevelop = True
basepython = {env:OPENSTACKSDK_TOX_PYTHON:python2}
passenv = UPPER_CONSTRAINTS_FILE
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
@ -25,6 +24,7 @@ commands = stestr --test-path ./openstack/tests/examples run {posargs}
stestr slowest
[testenv:functional]
basepython = {env:OPENSTACKSDK_TOX_PYTHON:python2}
passenv = OS_* OPENSTACKSDK_* UPPER_CONSTRAINTS_FILE
commands = stestr --test-path ./openstack/tests/functional run --serial {posargs}
stestr slowest
@ -55,6 +55,7 @@ commands =
[testenv:ansible]
# Need to pass some env vars for the Ansible playbooks
basepython = {env:OPENSTACKSDK_TOX_PYTHON:python2}
passenv = HOME USER
commands = {toxinidir}/extras/run-ansible-tests.sh -e {envdir} {posargs}