From fa8df69194be12b9fe97253d8dd14013381ca92a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 10 Nov 2023 00:05:52 +0900 Subject: [PATCH] Fix unit tests broken by olso.utils Some of the object unit tests grub Mock object unintentionally, and that results in failure during initializing an versioned object, because the Mock object does not present its version correctly. This fixes that problem. The sqlalchemy-2x job is made non-voting because this job requires oslo.utils 6.3.0 which is blocked by this problem. Closes-Bug: #2043116 Related-Bug: #2042886 Change-Id: I1a622ab9c766d46b7eb4442848e91f25b26f6c61 --- ironic/tests/unit/objects/test_objects.py | 2 ++ zuul.d/ironic-jobs.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ironic/tests/unit/objects/test_objects.py b/ironic/tests/unit/objects/test_objects.py index 3546f3721a..ceb69d90db 100644 --- a/ironic/tests/unit/objects/test_objects.py +++ b/ironic/tests/unit/objects/test_objects.py @@ -980,6 +980,7 @@ class TestObjectSerializer(test_base.TestCase): class TestRegistry(test_base.TestCase): @mock.patch('ironic.objects.base.objects', autospec=True) def test_hook_chooses_newer_properly(self, mock_objects): + del mock_objects.MyObj reg = base.IronicObjectRegistry() reg.registration_hook(MyObj, 0) @@ -996,6 +997,7 @@ class TestRegistry(test_base.TestCase): @mock.patch('ironic.objects.base.objects', autospec=True) def test_hook_keeps_newer_properly(self, mock_objects): + del mock_objects.MyObj reg = base.IronicObjectRegistry() reg.registration_hook(MyObj, 0) diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml index 402432c189..2812c00014 100644 --- a/zuul.d/ironic-jobs.yaml +++ b/zuul.d/ironic-jobs.yaml @@ -697,6 +697,8 @@ tox_envlist: py3 # The job only tests the latest and shouldn't be run on the stable branches branches: ^master$ + # TODO(tkajinam): Make this voting once oslo.utils is bumped to 6.3.0 + voting: false required-projects: - name: github.com/sqlalchemy/sqlalchemy override-checkout: main