tox -efunctional fails when tox picks python 3.x

Bug #1632521 reported by melanie witt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
melanie witt

Bug Description

Currently, the functional tests can't be run with python 3.x and fail with a trace like this:

Failed to import test module: nova.tests.functional.api_sample_tests.test_volumes
Traceback (most recent call last):
  File "/home/ubuntu/nova/.tox/functional/lib/python3.5/site-packages/unittest2/loader.py", line 456, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/ubuntu/nova/.tox/functional/lib/python3.5/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
    __import__(name)
  File "/home/ubuntu/nova/nova/tests/functional/api_sample_tests/test_volumes.py", line 21, in <module>
    from nova.tests.functional.api_sample_tests import test_servers
  File "/home/ubuntu/nova/nova/tests/functional/api_sample_tests/test_servers.py", line 24, in <module>
    class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21):
  File "/home/ubuntu/nova/nova/tests/functional/api_sample_tests/test_servers.py", line 29, in ServersSampleBase
    user_data = base64.b64encode(user_data_contents)
  File "/home/ubuntu/nova/.tox/functional/lib/python3.5/base64.py", line 59, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: a bytes-like object is required, not 'str'
The test run didn't actually run any tests
ERROR: InvocationError: '/bin/bash tools/pretty_tox.sh nova.tests.functional.db'
________________________________________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________________________________________
ERROR: functional: commands failed

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/385207

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/385207
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=32e533d59abcd2ec27eebf174b492a75a85e7554
Submitter: Jenkins
Branch: master

commit 32e533d59abcd2ec27eebf174b492a75a85e7554
Author: melanie witt <email address hidden>
Date: Tue Oct 11 23:59:25 2016 +0000

    Always use python2.7 for functional tests

    The functional testenv doesn't work with python 3.x on our codebase.
    If someone is on a platform that defaults to python => python3,
    functional tests will fail for them.

    Closes-Bug: #1632521

    Change-Id: I7bf6653f55c10d0a4f75054e519edf7da19c5c09

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/394247

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b1

This issue was fixed in the openstack/nova 15.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/mitaka)

Reviewed: https://review.openstack.org/394247
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6f75db11d3d7b5f9921ca632df4e9e5e198f79b6
Submitter: Jenkins
Branch: stable/mitaka

commit 6f75db11d3d7b5f9921ca632df4e9e5e198f79b6
Author: melanie witt <email address hidden>
Date: Tue Oct 11 23:59:25 2016 +0000

    Always use python2.7 for functional tests

    The functional testenv doesn't work with python 3.x on our codebase.
    If someone is on a platform that defaults to python => python3,
    functional tests will fail for them.

    Closes-Bug: #1632521

    Change-Id: I7bf6653f55c10d0a4f75054e519edf7da19c5c09
    (cherry picked from commit 32e533d59abcd2ec27eebf174b492a75a85e7554)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 13.1.3

This issue was fixed in the openstack/nova 13.1.3 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.