Activity log for bug #1843498

Date Who What changed Old value New value Message
2019-09-10 20:39:57 Goutham Pacha Ravi bug added bug
2019-09-10 20:40:12 Goutham Pacha Ravi tags low-hanging-fruit tests unit
2019-09-10 20:40:16 Goutham Pacha Ravi manila: importance Undecided Low
2019-09-10 20:41:28 Goutham Pacha Ravi description This bug is a result of the code review iterations on https://review.opendev.org/#/c/669651/. There was a unit test added to check that, when a share type with name "ABC" exists, another share type's name cannot be updated to be "ABC". This collision in names is guarded by uniqueness constraints in the "share_types" and "share_group_types" tables [1][2][3][4]. However, unit tests run on Sqlite, and this constraint isn't holding. The unit test that failed: https://review.opendev.org/#/c/669651/27/manila/tests/db/sqlalchemy/test_api.py@3278 manila/tests/db/sqlalchemy/test_api.py def test_share_type_update_name_exist(self): db_utils.create_share_type( name='exist_name', extra_specs={'somekey': 'someval'}) share_type = db_utils.create_share_type(name='regalia') values = {"name": "exist_name"} self.assertRaises(exception.ShareTypeExists, db_api.share_type_update, self.ctxt, share_type['id'], values) Failure observed in the unit tests: Captured traceback: ~~~~~~~~~~~~~~~~~~~ Traceback (most recent call last): File "manila/tests/db/sqlalchemy/test_api.py", line 3285, in test_share_type_update_name_exist self.ctxt, share_type['id'], values) File "/home/zuul/src/opendev.org/openstack/manila/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 485, in assertRaises self.assertThat(our_callable, matcher) File "/home/zuul/src/opendev.org/openstack/manila/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat raise mismatch_error testtools.matchers._impl.MismatchError: <function share_type_update at 0x7f8d9c0fd938> returned None This bug is a result of the code review iterations on https://review.opendev.org/#/c/669651/. There was a unit test added to check that, when a share type with name "ABC" exists, another share type's name cannot be updated to be "ABC". This collision in names is guarded by uniqueness constraints in the "share_types" and "share_group_types" tables [1][2][3][4]. However, unit tests run on Sqlite, and this constraint isn't holding. The unit test that failed: https://review.opendev.org/#/c/669651/27/manila/tests/db/sqlalchemy/test_api.py@3278  manila/tests/db/sqlalchemy/test_api.py      def test_share_type_update_name_exist(self):         db_utils.create_share_type(             name='exist_name', extra_specs={'somekey': 'someval'})         share_type = db_utils.create_share_type(name='regalia')         values = {"name": "exist_name"}         self.assertRaises(exception.ShareTypeExists,                           db_api.share_type_update,                           self.ctxt, share_type['id'], values) Failure observed in the unit tests:     Captured traceback:     ~~~~~~~~~~~~~~~~~~~     Traceback (most recent call last):       File "manila/tests/db/sqlalchemy/test_api.py", line 3285, in test_share_type_update_name_exist         self.ctxt, share_type['id'], values)       File "/home/zuul/src/opendev.org/openstack/manila/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 485, in assertRaises         self.assertThat(our_callable, matcher)       File "/home/zuul/src/opendev.org/openstack/manila/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat         raise mismatch_error     testtools.matchers._impl.MismatchError: <function share_type_update at 0x7f8d9c0fd938> returned None [1] https://opendev.org/openstack/manila/src/branch/master/manila/db/migrations/alembic/versions/162a3e673105_manila_init.py#L367 [2] https://opendev.org/openstack/manila/src/branch/master/manila/db/migrations/alembic/versions/38e632621e5a_change_volume_type_to_share_type.py#L47 [3] https://opendev.org/openstack/manila/src/commit/f1e10ec2ff44445a7a6e10eba3f270e1dbd3a889/manila/db/migrations/alembic/versions/e1949a93157a_add_share_group_types_table.py#L49-L51 [4] https://opendev.org/openstack/manila/src/commit/f1e10ec2ff44445a7a6e10eba3f270e1dbd3a889/manila/db/sqlalchemy/models.py#L1068-L1070
2019-09-10 20:42:01 Goutham Pacha Ravi bug added subscriber haixin
2019-10-30 17:35:35 Goutham Pacha Ravi tags low-hanging-fruit tests unit tests
2023-05-18 15:20:04 Vida Haririan manila: status New Triaged
2023-05-18 15:45:43 Vida Haririan tags tests low-hanging-fruit tests