Fix currently broken and inactive mysql tests
Commit 868dd84854
added a
migration script that caused there to be two heads (starting
points) of migrations which would cause alembic to be unable
to do the initial schema creation (and upgrade).
So this fixes that by correctly making one head only and
not skipping tests for a database if it can not be
upgraded for whatever reason (which was silencing the
test failures).
Closes-bug: #1528683
Change-Id: Id571072eec1dc3b6cbb9e868854f6db0b271e5f8
This commit is contained in:
@@ -17,14 +17,14 @@
|
||||
"""Switch postgres to json native type.
|
||||
|
||||
Revision ID: 2ad4984f2864
|
||||
Revises: 589dccdf2b6e
|
||||
Revises: 3162c0f3f8e4
|
||||
Create Date: 2015-06-04 13:08:36.667948
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2ad4984f2864'
|
||||
down_revision = '589dccdf2b6e'
|
||||
down_revision = '3162c0f3f8e4'
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
@@ -160,14 +160,11 @@ class BackendPersistenceTestMixin(base.PersistenceTestMixin):
|
||||
except Exception as e:
|
||||
self.skipTest("Failed to create temporary database;"
|
||||
" testing being skipped due to: %s" % (e))
|
||||
try:
|
||||
else:
|
||||
self.backend = impl_sqlalchemy.SQLAlchemyBackend(self.db_conf)
|
||||
self.addCleanup(self.backend.close)
|
||||
with contextlib.closing(self._get_connection()) as conn:
|
||||
conn.upgrade()
|
||||
except Exception as e:
|
||||
self.skipTest("Failed to setup your database;"
|
||||
" testing being skipped due to: %s" % (e))
|
||||
|
||||
|
||||
@testtools.skipIf(not _mysql_exists(), 'mysql is not available')
|
||||
|
Reference in New Issue
Block a user