summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-21 00:33:20 +0000
committerGerrit Code Review <review@openstack.org>2013-02-21 00:33:20 +0000
commite6c25d17b498ff7e5a6e2f2710916ffe979ee3d3 (patch)
tree6eec86b8b315b0f87835fc6d04a584efa7860c13 /nova
parent9824ce04dbc3de4581e27c23c6bafe1b78efbf1a (diff)
parent966307ab3da52b5e5eb6be1e4ce6cfcd1c1b1179 (diff)
Merge "ensure we run db tests in CI"
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/test_migrations.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index 6f55ce846..f800d2eb7 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -117,6 +117,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.
@@ -273,7 +280,7 @@ class BaseMigrationTestCase(test.TestCase):
def _test_mysql_opportunistically(self, database=None):
# 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.
@@ -316,7 +323,7 @@ class BaseMigrationTestCase(test.TestCase):
def _test_postgresql_opportunistically(self, database=None):
# 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.