unit-tests failing for trove/tests/unittests/mgmt/test_models.py

Bug #1469724 reported by Sushil Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Sushil Kumar

Bug Description

The unittests in module trove/tests/unittests/mgmt/test_models.py are failing when run alone.

The log for failing tests is as follows:

(py27)ubuntu@contributor:/mnt/coding/requirements/trove/trove/tests/unittests/mgmt$ python -m testtools.run test_models.py
Tests running...
No handlers could be found for logger "trove.extensions.mgmt.instances.models"
======================================================================
ERROR: test_models.TestMgmtInstanceDeleted.test_show_deleted_mgmt_instances
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 420, in test_show_deleted_mgmt_instances
    active_instance = db_infos_active.all()[0]
IndexError: list index out of range
======================================================================
ERROR: test_models.TestMgmtInstancePing.test_rpc_ping
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 444, in test_rpc_ping
    status, task_status=InstanceTasks.NONE)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestMgmtInstanceTasks.test_public_exists_events
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 371, in test_public_exists_events
    status, task_status=InstanceTasks.BUILDING)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNotificationTransformer.test_tranformer
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 129, in test_tranformer
    status, InstanceTasks.BUILDING)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNovaNotificationTransformer.test_tranformer
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 190, in test_tranformer
    status, InstanceTasks.BUILDING)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNovaNotificationTransformer.test_tranformer_flavor_cache
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 326, in test_tranformer_flavor_cache
    status, InstanceTasks.BUILDING)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNovaNotificationTransformer.test_tranformer_invalid_datastore_manager
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 228, in test_tranformer_invalid_datastore_manager
    status, InstanceTasks.BUILDING)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNovaNotificationTransformer.test_tranformer_no_nova_instance
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 300, in test_tranformer_no_nova_instance
    instance, service_status = self.build_db_instance(status)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_models.TestNovaNotificationTransformer.test_tranformer_shutdown_instance
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_models.py", line 272, in test_tranformer_shutdown_instance
    instance, service_status = self.build_db_instance(status)
  File "test_models.py", line 100, in build_db_instance
    datastore_version_id=version.id,
AttributeError: 'NoneType' object has no attribute 'id'

Ran 13 tests in 24.286s
FAILED (failures=9)

Changed in trove:
importance: Undecided → High
milestone: none → liberty-2
Changed in trove:
assignee: nobody → Sushil Kumar (sushil-kumar2)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/196676
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=eb7e9c50bada65884fb5d9c7516f18723e552a58
Submitter: Jenkins
Branch: master

commit eb7e9c50bada65884fb5d9c7516f18723e552a58
Author: Sushil Kumar <email address hidden>
Date: Mon Jun 29 14:02:45 2015 +0000

    Fixed the tests in test_models.py

    The tests were failing when run as a single module
    for the test-module trove.tests.unittests.mgmt.test_models

    There were two reasons of failure:
    - test_models.TestMgmtInstanceDeleted.test_show_deleted_mgmt_instances fails
      because this test expects some deleted/active instances to pre-exist.
    - other tests were failing because MockMgmtInstanceTest.build_db_instance
      was trying to create test-instances using a non-existent version.

    Change-Id: Ie0b4bb9b60f451f97961744d19f62cd7f0240458
    Closes-Bug: #1469724

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: liberty-2 → 4.0.0
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.