ensure we run db tests in CI

CI had a set of environmental variables that refused to allow the
tests from failing gracefully. These seem to have gotten lost
along the way in refactoring.

Change-Id: Ib19b5d472c51ed72b8acf1571dd19f41474532c5
This commit is contained in:
Sean Dague
2013-02-20 07:23:52 -05:00
parent 2d6eee81ba
commit 65039d27ad

View File

@@ -109,6 +109,13 @@ def _have_mysql():
return present.lower() in ('', 'true')
def _have_postgresql():
present = os.environ.get('NOVA_TEST_POSTGRESQL_PRESENT')
if present is None:
return _is_backend_avail('postgres')
return present.lower() in ('', 'true')
def get_table(engine, name):
"""Returns an sqlalchemy table dynamically from db.
@@ -257,7 +264,7 @@ class TestMigrations(BaseMigrationTestCase):
def test_mysql_opportunistically(self):
# Test that table creation on mysql only builds InnoDB tables
if not _is_backend_avail('mysql'):
if not _have_mysql():
self.skipTest("mysql not available")
# add this to the global lists to make reset work with it, it's removed
# automatically in tearDown so no need to clean it up here.
@@ -296,7 +303,7 @@ class TestMigrations(BaseMigrationTestCase):
def test_postgresql_opportunistically(self):
# Test postgresql database migration walk
if not _is_backend_avail('postgres'):
if not _have_postgresql():
self.skipTest("postgresql not available")
# add this to the global lists to make reset work with it, it's removed
# automatically in tearDown so no need to clean it up here.