test_generator_raises_error unit tests fails with stevedore > 2.0.1

Bug #1888208 reported by yatin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
Fix Released
Undecided
yatin
oslo.policy
Fix Released
Undecided
yatin

Bug Description

Detected while bumping oslo policy to 3.3.1 in RDO[1], Tests fails with below traceback, Failing in upstream gates too, tested via https://review.opendev.org/#/c/741869/. Tests pass with stevedore <= 2.0.1, need to make it compatible with stevedore> 2.0.1

DEBUG: ==============================
DEBUG: Failed 1 tests - output below:
DEBUG: ==============================
DEBUG: oslo_policy.tests.test_generator.GeneratorRaiseErrorTestCase.test_generator_raises_error
DEBUG: ----------------------------------------------------------------------------------------
DEBUG: Captured traceback:
DEBUG: ~~~~~~~~~~~~~~~~~~~
DEBUG: Traceback (most recent call last):
DEBUG: File "/builddir/build/BUILD/oslo.policy-3.3.1/oslo_policy/tests/test_generator.py", line 498, in test_generator_raises_error
DEBUG: fake_ep.name)
DEBUG: File "/usr/lib/python3.6/site-packages/testtools/testcase.py", line 485, in assertRaises
DEBUG: self.assertThat(our_callable, matcher)
DEBUG: File "/usr/lib/python3.6/site-packages/testtools/testcase.py", line 498, in assertThat
DEBUG: raise mismatch_error
DEBUG: testtools.matchers._impl.MismatchError: <function _generate_sample at 0x7fb311096c80> returned None

https://logserver.rdoproject.org/02/28602/2/check/rdoinfo-DLRN-check-centos8/8704d48/buildset/centos-rpm-master/repos/component/common/ca/b2/cab28649c689067970a51a2f9b329bdd6a0f0501_dev/mock.log

Changed in oslo.policy:
assignee: nobody → yatin (yatinkarel)
status: New → In Progress
Revision history for this message
yatin (yatinkarel) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.policy (master)

Reviewed: https://review.opendev.org/741869
Committed: https://git.openstack.org/cgit/openstack/oslo.policy/commit/?id=6296fce9f8e3205506f87dd31d0b18f4b7842000
Submitter: Zuul
Branch: master

commit 6296fce9f8e3205506f87dd31d0b18f4b7842000
Author: yatinkarel <email address hidden>
Date: Tue Jul 21 09:55:42 2020 +0530

    Fix unit tests to work with stevedore > 2.0.1

    stevedore has switched to importlib_metadata[1] and
    this breaked unit test as the test relied on internal
    implementation of it.

    Instead we should switch to mock NamedExtensionManager
    that's what called by oslo_policy.

    [1] https://review.opendev.org/#/c/739306/

    Closes-Bug: #1888208
    Change-Id: I993d743c53fa3506ceda3d1f291c12f4635eb60a

Changed in oslo.policy:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/742589

Changed in oslo.config:
assignee: nobody → yatin (yatinkarel)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.opendev.org/742589
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=a2652b3584da06e4c4ebe96261672309b01c1122
Submitter: Zuul
Branch: master

commit a2652b3584da06e4c4ebe96261672309b01c1122
Author: yatinkarel <email address hidden>
Date: Thu Jul 23 11:05:05 2020 +0530

    Fix unit tests to work with stevedore > 2.0.1

    stevedore has switched to importlib_metadata[1] and
    this breaked unit test as the test relied on internal
    implementation of it.

    Instead we should switch to mock NamedExtensionManager
    that's what called by oslo_config.

    [1] https://review.opendev.org/#/c/739306/

    Closes-Bug: #1888208
    Change-Id: Ic4b990a387d875a351c9f8e7eaaef726734ff305

Changed in oslo.config:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.