Public bug reported: 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... ** Affects: nova Importance: Undecided Assignee: Ryan Rossiter (rlrossit) Status: New ** Tags: testing ** Summary changed: - test_obj_make_compatible() does not call __init__ properly on NotificationPayloadBase objects + test_obj_make_compatible() does not call __init__ properly on ServiceStatusPayload objects ** Changed in: nova Assignee: (unassigned) => Ryan Rossiter (rlrossit) ** Tags added: testing -- 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): New 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 -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp