test_migration_utils runs sqlite tests even if no sqlite configured

Bug #1275352 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

There are several jobs that only run if you have sqlite configured in nova.tests.db.test_migration_utils but there are two which will run and fail if you don't have sqlite configured:

======================================================================
ERROR: nova.tests.db.test_migration_utils.TestMigrationUtils.test_check_shadow_table_with_unsupported_type
----------------------------------------------------------------------
_StringException: pythonlogging:'': {{{INFO [nova.tests.db.test_migrations] Creating DB2 schema nova.novatstu}}}

Traceback (most recent call last):
  File "/root/nova-es/nova/tests/db/test_migration_utils.py", line 391, in test_check_shadow_table_with_unsupported_type
    engine = self.engines['sqlite']
KeyError: 'sqlite'

======================================================================
ERROR: nova.tests.db.test_migration_utils.TestMigrationUtils.test_util_drop_unique_constraint_with_not_supported_sqlite_type
----------------------------------------------------------------------
_StringException: pythonlogging:'': {{{INFO [nova.tests.db.test_migrations] Creating DB2 schema nova.novatstu}}}

Traceback (most recent call last):
  File "/root/nova-es/nova/tests/db/test_migration_utils.py", line 215, in test_util_drop_unique_constraint_with_not_supported_sqlite_type
    for i in xrange(0, len(values)):
UnboundLocalError: local variable 'values' referenced before assignment

Those should be skipped if sqlite isn't configured like the other sqlite-specific tests.

Tags: db testing
Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: New → In Progress
Joe Gordon (jogo)
Changed in nova:
importance: Undecided → Low
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/70554
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c283576770b1bb96fd3dd012c6ced22b2a8eb903
Submitter: Jenkins
Branch: master

commit c283576770b1bb96fd3dd012c6ced22b2a8eb903
Author: Matt Riedemann <email address hidden>
Date: Sat Feb 1 14:04:05 2014 -0800

    Skip sqlite-specific tests if sqlite is not configured

    There are several tests in test_migration_utils which only work if
    sqlite is configured for migration tests, but two of them are missing
    the conditional checks for skipping the test.

    Also renames test_check_shadow_table_with_unsupported_type to
    test_check_shadow_table_with_unsupported_sqlite_type since it's specific
    to sqlite.

    Closes-Bug: #1275352

    Change-Id: I46f1b95e654bc702c76790350a8929d03c04e0a1

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/79682

Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
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.