Trove should have unit tests isolated from fake-mode int-tests

Bug #1372895 reported by Denis M. on 2014-09-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Medium
Unassigned

Bug Description

Trove should have unit tests isolated from fake-mode int-tests.
Due to use of common sqllite backend during tox testing unit tests are not failing because sqlite contains required data, such as:
datastore and its versions.

This issue cause next bugs:

 [1] https://bugs.launchpad.net/trove/+bug/1302784
 [2] https://bugs.launchpad.net/trove/+bug/1372950

Steps to fix:

1. Propose method that cleans up backend right after fake-mode int tests are finished. ( the opposite method to util.init_db() )
2. For those tests that are requiring datastore and versions - use common parent class inherited from testtools.TestCase and new class that will hadle datastore registration.

Clarification:

For some reasons (unkonw) int tests attribute was used for unit tests, that why tests at [1] are failing.

https://github.com/openstack/trove/blob/master/trove/tests/unittests/instance/test_instance_status.py#L21

https://github.com/openstack/trove/blob/master/trove/tests/unittests/instance/test_instance_status.py#L36

After further investigation:
17 tests are not isolated and sharing same backend data:

   trove/tests/unittests/backup - 5 usages
   trove/tests/unittests/common - 1 usage (not needed at all)
   trove/tests/unittests/conductor - 1 usage
   trove/tests/unittests/datastore - 1 usage
   trove/tests/unittests/guestagent - 6 usages (which is wrong completely becuase agent is on its way to be moved from codebase)

   trove/tests/unittests/instance - 1 usage
   trove/tests/unittests/mgmt - 1 usage
   trove/tests/unittests/taskmanager - 1 usage

Denis M. (dmakogon) on 2014-09-23
description: updated
Denis M. (dmakogon) on 2014-09-23
description: updated
Denis M. (dmakogon) on 2014-09-25
description: updated
Denis M. (dmakogon) on 2014-09-25
description: updated
Denis M. (dmakogon) on 2014-09-25
description: updated

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

Changed in trove:
assignee: nobody → Denis M. (dmakogon)
status: Confirmed → In Progress

Change abandoned by Denis M. (<email address hidden>) on branch: master
Review: https://review.openstack.org/125060

Changed in trove:
status: In Progress → Incomplete
milestone: kilo-1 → none
Amrith Kumar (amrith) on 2016-04-05
Changed in trove:
assignee: Denis M. (dmakogon) → nobody
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers