← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1537882] Re: test_obj_make_compatible() does not call __init__ properly on ServiceStatusPayload objects

 

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

commit e36bc6ee352600d77f4b2cbf352bf2a09933c86d
Author: Ryan Rossiter <rlrossit@xxxxxxxxxx>
Date:   Mon Jan 25 22:01:27 2016 +0000

    Use ovo in test_obj_make_compatible()
    
    o.vo has a fixture for testing compatibility routines. This changes the
    nova unit tests to use that compatibility testing on all objects. In the
    original nova test, the versions tested were from 1.0 to 1.(x-1), where
    1.x is the current version. o.vo's fixture tests from 1.0 to 1.x, which
    should be a no-op, but is also a good thing to test (if we can't convert
    1.x to 1.x, that's a bad thing).
    
    o.vo also had an enhancement where it passed args and kwargs to __init__
    in the different objects, which was a bug in nova, but using that
    fixture allows us to also close the nova bug. This change in o.vo was
    I62646b99adca47a9c9fe0f466f7a23ac8fa4553e.
    
    Change-Id: Ie127f55f2e5bcd383796ff51253cf1091be16c98
    Closes-Bug: #1537882


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1537882

Title:
  test_obj_make_compatible() does not call __init__ properly on
  ServiceStatusPayload objects

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Because I can tell the future, the test_obj_make_compatible() method
  will start failing the next time we bump the version of
  ServiceStatusPayload.

  It looks like in
  https://github.com/openstack/nova/blob/master/nova/tests/unit/objects/test_objects.py#L1252-L1268
  we run compatibility checks on all previous versions to see if we're
  compatible with them. It does not test current->current conversion
  though, so in the case of ServiceStatusPayload, which is currently at
  1.0, that for loop is never run.

  I caught this in my change
  (https://review.openstack.org/#/c/259112/2/nova/tests/unit/objects/test_objects.py)
  because ovo's compatibility checker includes checking from 1.0 to 1.0
  (https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/fixture.py#L302-L310),
  and I'm trying to change nova's tests to use the o.vo fixture. In my
  tests, ServiceStatusPayload is causing:

  Traceback (most recent call last):
    File "nova/tests/unit/objects/test_objects.py", line 1259, in test_obj_make_compatible
      checker.test_compatibility_routines(use_manifest=True)
    File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fixture.py", line 325, in test_compatibility_routines
      self._test_object_compatibility(obj_class, manifest=manifest)
    File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fixture.py", line 309, in _test_object_compatibility
      obj_class().obj_to_primitive(**kwargs)
  TypeError: __init__() takes exactly 2 arguments (1 given)

  So we need to somehow inject args to __init__() when we need to...

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1537882/+subscriptions


References