nosetests won't run tests on a fresh git clone of glance due to version issue

Bug #1118845 reported by Jay Buffington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Davanum Srinivas (DIMS)
Grizzly
Fix Released
Undecided
Davanum Srinivas (DIMS)

Bug Description

As you can see below I have the latest rev of glance in a clean tree. I run
nosetests -x and it fails because it is unable to determine what version of
glance I'm using. Note that I don't have glance installed on the system
anywhere but I have installed all the dependencies listed in the
tools/{pip,test}-requires files.

It looks to me that glance.common.config always looks for the version in
PKG-INFO and that file doesn't exist in a fresh git clone.

    $ git rev-parse HEAD
    9266f8e692ac728c1539198112469358ec507d2a

    $ git status
    # On branch master
    nothing to commit (working directory clean)

    $ nosetests -x

    TestDriver
        test_image_create_defaults ERROR 0.02

    ======================================================================
    ERROR: glance.tests.functional.db.test_simple.TestDriver.test_image_create_defaults
    ----------------------------------------------------------------------
    _StringException: Traceback (most recent call last):
      File "/home/jaybuff/openstack/glance/glance/tests/functional/db/base.py", line 71, in setUp
        super(TestDriver, self).setUp()
      File "/home/jaybuff/openstack/glance/glance/tests/unit/base.py", line 53, in setUp
        super(IsolatedUnitTest, self).setUp()
      File "/home/jaybuff/openstack/glance/glance/tests/unit/base.py", line 38, in setUp
        super(StoreClearingUnitTest, self).setUp()
      File "/home/jaybuff/openstack/glance/glance/tests/utils.py", line 47, in setUp
        config.parse_args(args=[])
      File "/home/jaybuff/openstack/glance/glance/common/config.py", line 87, in parse_args
        version=version.cached_version_string(),
      File "/home/jaybuff/openstack/glance/glance/openstack/common/version.py", line 85, in cached_version_string
        self.version_string())
      File "/home/jaybuff/openstack/glance/glance/openstack/common/version.py", line 63, in version_string
        for part in self.release_string().split('.'):
    AttributeError: 'NoneType' object has no attribute 'split'

Revision history for this message
Jay Buffington (jaybuff) wrote :

Note that doing this works around the issue and allows nosetests to run the
tests:

    $ sudo python ./setup.py egg_info
    running egg_info
    writing requirements to glance.egg-info/requires.txt
    writing glance.egg-info/PKG-INFO
    writing top-level names to glance.egg-info/top_level.txt
    writing dependency_links to glance.egg-info/dependency_links.txt
    reading manifest file 'glance.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'builddeb.sh'
    warning: no files found matching 'AUTHORS'
    warning: no files found matching 'run_tests.py'
    warning: no files found matching 'ChangeLog'
    writing manifest file 'glance.egg-info/SOURCES.txt'

    $ ln -s glance.egg-info/PKG-INFO .

    $ nosetests -x

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

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

Changed in glance:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/21485
Committed: http://github.com/openstack/glance/commit/6b706f1afc445fd69922c47d663478f3306b7d7f
Submitter: Jenkins
Branch: master

commit 6b706f1afc445fd69922c47d663478f3306b7d7f
Author: Davanum Srinivas <email address hidden>
Date: Thu Feb 7 21:55:02 2013 -0500

    Fix version issue during nosetests run

    Pick up the latest files from oslo

    Fixes LP# 1118845

    Change-Id: I1c9a19508fc18f18936624fa233d3fdc6d31e43f

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
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.