From f2a9ff59b57ebfb6950d2a8fa6d41cce230b92e7 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sun, 13 Sep 2015 17:55:48 -0400 Subject: [PATCH] Add a link versioned object document If the test 'test_objects' fails, it is handy to display the link to the versioned object document, which help contributors to understand the version bumping policy. Change-Id: I88d25281f5a1d5e28ba4e2dd813a3b4ad5ce881a Closes-Bug: #1491855 --- doc/source/objects.rst | 4 ++-- magnum/tests/unit/objects/test_objects.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/source/objects.rst b/doc/source/objects.rst index 3782e10d8c..3a4a0673c1 100644 --- a/doc/source/objects.rst +++ b/doc/source/objects.rst @@ -58,7 +58,7 @@ This results in a unit test failure with the following output:: testtools.matchers._impl.MismatchError: !=: reference = {'Container': '1.0-e12affbba5f8a748882a3ae98aced282'} actual = {'Container': '1.0-22b40e8eed0414561ca921906b189820'} - : Fields or remotable methods in some objects have changed. Make sure the versions of the objects has been bumped, and update the hashes in the static fingerprints tree (object_data). + : Fields or remotable methods in some objects have changed. Make sure the versions of the objects has been bumped, and update the hashes in the static fingerprints tree (object_data). For more information, read http://docs.openstack.org/developer/magnum/objects.html. This is an indication that me adding the 'foo' field to Container means I need to bump the version of Container, so I increase the version and add a comment @@ -77,7 +77,7 @@ tell me the fingerprint that I now need to put in the static tree:: testtools.matchers._impl.MismatchError: !=: reference = {'Container': '1.0-e12affbba5f8a748882a3ae98aced282'} actual = {'Container': '1.1-22b40e8eed0414561ca921906b189820'} - : Fields or remotable methods in some objects have changed. Make sure the versions of the objects has been bumped, and update the hashes in the static fingerprints tree (object_data). + : Fields or remotable methods in some objects have changed. Make sure the versions of the objects has been bumped, and update the hashes in the static fingerprints tree (object_data). For more information, read http://docs.openstack.org/developer/magnum/objects.html. I can now copy the new fingerprint needed (1.1-22b40e8eed0414561ca921906b189820), to the object_data map within magnum/tests/unit/objects/test_objects.py:: diff --git a/magnum/tests/unit/objects/test_objects.py b/magnum/tests/unit/objects/test_objects.py index efd2de2568..bda41381da 100644 --- a/magnum/tests/unit/objects/test_objects.py +++ b/magnum/tests/unit/objects/test_objects.py @@ -450,7 +450,9 @@ class TestObjectVersions(test_base.TestCase): "Fields or remotable methods in some objects have " "changed. Make sure the versions of the objects has " "been bumped, and update the hashes in the static " - "fingerprints tree (object_data).") + "fingerprints tree (object_data). For more " + "information, read http://docs.openstack.org/" + "developer/magnum/objects.html.") class TestObjectSerializer(test_base.TestCase):