diff options
| author | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-02-20 07:23:52 -0500 |
|---|---|---|
| committer | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-02-20 07:25:52 -0500 |
| commit | 966307ab3da52b5e5eb6be1e4ce6cfcd1c1b1179 (patch) | |
| tree | 3d2fe5321e2bbc00f3ff39b8b4b8c1fc1e60de21 | |
| parent | e37e02870216ea6de130ce3d1b2e8f642de9faf6 (diff) | |
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
| -rw-r--r-- | nova/tests/test_migrations.py | 11 |
1 files changed, 9 insertions, 2 deletions
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. |
