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: Id1c1b77c020e2d8f0ac61c2aee86c9f37d388d53
This commit is contained in:
Takashi Kajinami 2023-11-09 23:58:39 +09:00
parent 1e75373beb
commit e04d20a8bc
2 changed files with 4 additions and 0 deletions
.zuul.yaml
nova/tests/unit/objects

@ -36,6 +36,8 @@
Takes advantage of the base tox job's install-siblings feature.
# 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

@ -1040,6 +1040,7 @@ class TestArgsSerializer(test.NoDBTestCase):
class TestRegistry(test.NoDBTestCase):
@mock.patch('nova.objects.base.objects')
def test_hook_chooses_newer_properly(self, mock_objects):
del mock_objects.MyObj
reg = base.NovaObjectRegistry()
reg.registration_hook(MyObj, 0)
@ -1056,6 +1057,7 @@ class TestRegistry(test.NoDBTestCase):
@mock.patch('nova.objects.base.objects')
def test_hook_keeps_newer_properly(self, mock_objects):
del mock_objects.MyObj
reg = base.NovaObjectRegistry()
reg.registration_hook(MyObj, 0)