Tintri unit tests fail if run alone

Bug #1791089 reported by Sean McGinnis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Sean McGinnis

Bug Description

Tintri unit tests do not do proper setup relying on other unit tests to have done so. Running just "tox -e py35 -- cinder.tests.unit.volume.drivers.test_tintri" results in all tests failing with errors like:

cinder.tests.unit.volume.drivers.test_tintri.TintriDriverTestCase.test_create_cloned_volume
-------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/tmp/cinder/cinder/tests/unit/volume/drivers/test_tintri.py", line 50, in setUp'
    b' self._driver = TintriDriver(**kwargs)'
    b' File "/tmp/cinder/cinder/volume/drivers/tintri.py", line 97, in __init__'
    b' super(TintriDriver, self).__init__(*args, **kwargs)'
    b' File "/tmp/cinder/cinder/volume/drivers/nfs.py", line 123, in __init__'
    b' supports_auto=supports_auto_mosr))'
    b' File "/tmp/cinder/cinder/volume/utils.py", line 1018, in get_max_over_subscription_ratio'
    b' mosr = float(str_value)'
    b"TypeError: float() argument must be a string or a number, not 'Mock'"
    b''

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/600442

Changed in cinder:
assignee: nobody → Sean McGinnis (sean-mcginnis)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/600442
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=9585e6a15270d49ec936efba825bd9667f8aa6d1
Submitter: Zuul
Branch: master

commit 9585e6a15270d49ec936efba825bd9667f8aa6d1
Author: Sean McGinnis <email address hidden>
Date: Thu Sep 6 08:12:16 2018 -0500

    Tintri: Inherit tests from BaseDriverTestCase

    The Tintri tests would fail when run alone using:

    tox -e py35 -- cinder.tests.unit.volume.drivers.test_tintri

    This fixes that by making sure things are properly initialized by
    inheriting from the BaseDriverTestCase instead of TestCase directly.

    Closes-bug: #1791089

    Change-Id: I7057da284edec743243a54909d313aa2910d8d0d
    Signed-off-by: Sean McGinnis <email address hidden>

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/639750

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 14.0.0.0rc1

This issue was fixed in the openstack/cinder 14.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/rocky)

Reviewed: https://review.openstack.org/639750
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c8baa2821bdd76fab415a86bcab36d0f699a19d0
Submitter: Zuul
Branch: stable/rocky

commit c8baa2821bdd76fab415a86bcab36d0f699a19d0
Author: Sean McGinnis <email address hidden>
Date: Thu Sep 6 08:12:16 2018 -0500

    Tintri: Inherit tests from BaseDriverTestCase

    The Tintri tests would fail when run alone using:

    tox -e py35 -- cinder.tests.unit.volume.drivers.test_tintri

    This fixes that by making sure things are properly initialized by
    inheriting from the BaseDriverTestCase instead of TestCase directly.

    Closes-bug: #1791089

    Change-Id: I7057da284edec743243a54909d313aa2910d8d0d
    Signed-off-by: Sean McGinnis <email address hidden>
    (cherry picked from commit 9585e6a15270d49ec936efba825bd9667f8aa6d1)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 13.0.5

This issue was fixed in the openstack/cinder 13.0.5 release.

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.