From 966307ab3da52b5e5eb6be1e4ce6cfcd1c1b1179 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 20 Feb 2013 07:23:52 -0500 Subject: 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 --- nova/tests/test_migrations.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py index e2ab2df1f..239cc6fe0 100644 --- a/nova/tests/test_migrations.py +++ b/nova/tests/test_migrations.py @@ -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. -- cgit