unit test fails with the latest commit

Bug #1165962 reported by Akihiro Motoki
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Critical
Alex Xu
python-quantumclient (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

The unit test test_cli20_network fails with the latest commit:

commit 00935b8c1fb18351f8ff584f6b57596cdb5d7684
Merge: d41d223 3889ba2
Author: Jenkins <email address hidden>
Date: Sun Apr 7 08:19:26 2013 +0000

    Merge "Exclude top level 'tests dir' from packages."

$ tox -e py27
GLOB sdist-make: /opt/stack/python-quantumclient/setup.py
py27 inst-nodeps: /opt/stack/python-quantumclient/.tox/dist/python-quantumclient-2.2.1.10.g00935b8.zip
py27 runtests: commands[0]
running testr
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests --list
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmpsFBVt6
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmpoulX4w
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmpY7ioiz
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests --load-list /tmp/tmphDC1tJ
======================================================================
FAIL: tests.unit.test_cli20_network.CLITestV20Network.test_list_external_nets_empty_with_column
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/python-quantumclient/tests/unit/test_cli20_network.py", line 317, in test_list_external_nets_empty_with_column
    self.assertEquals('\n', _str)
MismatchError: '\n' != u'++\n||\n++\n++\n'
======================================================================
FAIL: tests.unit.test_cli20_network.CLITestV20Network.test_list_nets_empty_with_column
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/python-quantumclient/tests/unit/test_cli20_network.py", line 127, in test_list_nets_empty_with_column
    self.assertEquals('\n', _str)
MismatchError: '\n' != u'++\n||\n++\n++\n'
{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
Unknown command ['f', 'a', 'k', 'e']
You must provide a service URL via either --os-url or env[OS_URL]
You must provide a service URL via either --os-url or env[OS_URL]
Ran 217 tests in 0.403s (-0.059s)
FAILED (id=1, failures=2)
error: testr failed (1)
ERROR: InvocationError: '/opt/stack/python-quantumclient/.tox/py27/bin/python setup.py testr --testr-args='
__________________________________________________________________________ summary __________________________________________________________________________
ERROR: py27: commands failed

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The following commit is the cause.

commit 714ade07ac4d1ac0cdf545f5b0823e88af0c03ae
Author: Chris Krelle <email address hidden>
Date: Fri Mar 22 12:59:06 2013 -0700

    Update tools/pip-requires for prettytable

    changes pip-requires from:
        prettytable>=0.6,<0.7
    to:
        prettytable>=0.6,<0.8

    Change-Id: Ia4e7460525e73474c90cd0c50d3d1243f64f68eb
    Authored-by: Chris Krelle <email address hidden>

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The test fails with prettytable 0.7.2, and succeeds with prettytable 0.6.1.
prettytable 0.7.2 generates the different format for empty list, while prettytable 0.6.1 outputs just a newline for such case.

[0.7.2]
++
||
++
++

I am not sure what solution is good....

Changed in python-quantumclient:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Alex Xu (xuhj)
milestone: none → 2.2.1
Revision history for this message
yong sheng gong (gongysh) wrote :

If the OS install 0.7.2 prettytable, we need to upgrade cliff 1.3.2 too.
To fix the bugs, we need to keep the empty list behavior.

Revision history for this message
yong sheng gong (gongysh) wrote :

all other client glance, nova are using prettytable>=0.6,<0.8

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

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

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

Reviewed: https://review.openstack.org/26355
Committed: http://github.com/openstack/python-quantumclient/commit/e901c5fe8071914a867bbb981da5773ff2a1db6e
Submitter: Jenkins
Branch: master

commit e901c5fe8071914a867bbb981da5773ff2a1db6e
Author: He Jie Xu <email address hidden>
Date: Mon Apr 8 14:14:16 2013 +0800

    Add custom TableFormater for keep same empty list behavior as prettytable 0.6

    Fix bug 1165962

    And upgrade cliff to 1.3.2, because cliff 1.3.1 depends on prettytable<0.7

    Change-Id: I6b38a2d77f6b9bf88d6d64f6c02b98b6c21fda3a

Changed in python-quantumclient:
status: In Progress → Fix Committed
Revision history for this message
Aimon Bustardo (aimonb) wrote :

Cliff 1.3.2 is not available in Ubuntu repos. This makes the existing version of Quantum in http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-trunk-testing/ubuntu broken. What are the plans to get 1.3.2 into that repo?

Revision history for this message
Aimon Bustardo (aimonb) wrote :

A bit more info on my previous broken statement:

# dpkg --list |grep quantum
ii python-quantum 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virutal network service for Openstack - Python library
ii python-quantumclient 2:2.2.1.14.g3c193c9+git201304090346~precise-0ubuntu1 client - Quantum is a virtual network service for Openstack
ii quantum-common 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - common
ii quantum-dhcp-agent 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - DHCP agent
ii quantum-l3-agent 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - l3 agent
ii quantum-metadata-agent 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - metadata agent
ii quantum-plugin-openvswitch 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - Open vSwitch plugin
ii quantum-plugin-openvswitch-agent 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - Open vSwitch plugin agent
ii quantum-server 1:2013.1+git201304120101~precise-0ubuntu1 Quantum is a virtual network service for Openstack - server

The ERROR:

# quantum net-list
Traceback (most recent call last):
  File "/usr/bin/quantum", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2711, in <module>
    parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cliff>=1.3.2

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-quantumclient (Ubuntu):
status: New → Confirmed
James Page (james-page)
Changed in python-quantumclient (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Amir Sadoughi (amir-sadoughi) wrote :

With the latest cliff released on pypi today, 1.5.2, the code committed to fix this previous bug causes unit tests to fail:

Traceback (most recent call last):
...
File "neutronclient/neutron/v2_0/__init__.py", line 345, in __init__
self.formatters['table'] = TableFormater()
TypeError: 'ExtensionManager' object does not support item assignment

See http://logs.openstack.org/30/62130/4/check/gate-python-neutronclient-python27/6b6fc56/console.html for more info.

Changed in python-neutronclient:
status: Fix Committed → New
assignee: Alex Xu (xuhj) → Amir Sadoughi (amir-sadoughi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

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

Changed in python-neutronclient:
status: New → In Progress
Revision history for this message
Mark McClain (markmcclain) wrote :

This is not the correct bug to file this under. I have created a new bug to track this new issue: https://bugs.launchpad.net/python-neutronclient/+bug/1265926

Changed in python-neutronclient:
status: In Progress → Fix Released
assignee: Amir Sadoughi (amir-sadoughi) → Alex Xu (xuhj)
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.