Running glance nosetests fails

Bug #1103473 reported by Chuck Short
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Monty Taylor
Grizzly
Fix Released
Undecided
Monty Taylor
oslo-incubator
Fix Released
Critical
Monty Taylor
Grizzly
Fix Released
Critical
Monty Taylor

Bug Description

======================================================================
ERROR: glance.tests.functional.db.test_simple.TestDriver.test_image_create_defaults
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/tests/functional/db/base.py", line 71, in setUp
    super(TestDriver, self).setUp()
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/tests/unit/base.py", line 53, in setUp
    super(IsolatedUnitTest, self).setUp()
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/tests/unit/base.py", line 38, in setUp
    super(StoreClearingUnitTest, self).setUp()
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/tests/utils.py", line 47, in setUp
    config.parse_args(args=[])
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/common/config.py", line 77, in parse_args
    version=version.cached_version_string(),
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/openstack/common/version.py", line 78, in cached_version_string
    self.version_string())
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/openstack/common/version.py", line 56, in version_string
    for part in self.release_string().split('.'):
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/openstack/common/version.py", line 48, in release_string
    self.release = self._get_version_from_pkg_resources()
  File "/tmp/buildd/glance-2013.1.a21.g21cf2cf/glance/openstack/common/version.py", line 40, in _get_version_from_pkg_resources
    provider = pkg_resources.get_provider(requirement)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 215, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 696, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 594, in resolve
    raise DistributionNotFound(req)
DistributionNotFound: glance

Revision history for this message
Thierry Carrez (ttx) wrote :

That's likely to come from Monty's recent oslo.version changes.

Changed in oslo:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

To reproduce:

1. Setup a chroot
2. Install build depends via apt.
2. Run python setup.py sdist
3. Run the testsuite from the tarball created via sdist.

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

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

Changed in oslo:
assignee: nobody → Monty Taylor (mordred)
status: Confirmed → In Progress
Changed in glance:
assignee: nobody → Monty Taylor (mordred)
status: New → In Progress
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/20432

Revision history for this message
Mark McLoughlin (markmc) wrote :

Chuck - is this a regression? Doesn't the same thing happen if you do it with a git checkout?

Changed in oslo:
status: In Progress → Incomplete
Revision history for this message
Mark McLoughlin (markmc) wrote :

Ok, I just confirmed this is a regression

This is the glance commit which removed version info: https://github.com/openstack/glance/commit/1aaacf9

With 1aaacf9^

  $> git checkout 1aaacf9^
  $> python setup.py sdist # produces glance-2013.1.tar.gz
  $> tar -xvzf ... && cd ....
  $> pip freeze | grep glance # not installed
  $> nosetests -s glance.tests.unit.test_utils:TestUtils

works fine because we're reading the version from the version info file

With 1aaacf9

  $> git checkout 1aaacf9
  $> python setup.py sdist # produces glance-grizzly.2.9.g1aaacf9.tar.gz
  $> tar -xvzf ... && cd ....
  $> pip freeze | grep glance # not installed
  $> nosetests -s glance.tests.unit.test_utils:TestUtils

gets you a DistributionNotFound exception

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

Reviewed: https://review.openstack.org/20431
Committed: http://github.com/openstack/oslo-incubator/commit/5e69dd94bf81f55d6d5b917b7ec673482b5565c0
Submitter: Jenkins
Branch: master

commit 5e69dd94bf81f55d6d5b917b7ec673482b5565c0
Author: Monty Taylor <email address hidden>
Date: Fri Jan 25 08:12:28 2013 +1100

    Support running uninstalled in a tarball dir.

    Running tests from the directory of an expanded tarball is a reasonable
    thing to do, so support it by checking for PKG-INFO file if the pkg_resources
    version grab fails.

    Fixes bug 1103473

    Change-Id: I2bf1fc39b070d3a2cdf6a3abe5e816c81d2916a0

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

Reviewed: https://review.openstack.org/20432
Committed: http://github.com/openstack/glance/commit/94969ae8a17bc7b96a30b1064c6f9f4c6c845c62
Submitter: Jenkins
Branch: master

commit 94969ae8a17bc7b96a30b1064c6f9f4c6c845c62
Author: Monty Taylor <email address hidden>
Date: Fri Jan 25 08:16:13 2013 +1100

    Pull in tarball version fix from oslo.

    Fixes bug 1103473.

    Change-Id: I6ba67c2a8a0b7f3d488dc294882ef9f2c925bbf5

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