diff options
author | Stephen Finucane <stephenfin@redhat.com> | 2023-02-01 16:42:53 +0000 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2023-02-01 17:00:03 +0000 |
commit | fd39e4b4be9ddb18b96d5f8086955b91232f25e9 (patch) | |
tree | 9a6acba53ed307b1dcfa4f3cd219c4b2d892c662 /nova/tests/unit/db/api/test_migrations.py | |
parent | f01a90ccb85ab254236f84009cd432d03ce12ebb (diff) | |
download | nova-fd39e4b4be9ddb18b96d5f8086955b91232f25e9.tar.gz |
db: Remove legacy migrations
sqlalchemy-migrate does not (and will not) support sqlalchemy 2.0. We
need to drop these migrations to ensure we can upgrade our sqlalchemy
version.
Change-Id: I7756e393b78296fb8dbf3ca69c759d75b816376d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'nova/tests/unit/db/api/test_migrations.py')
-rw-r--r-- | nova/tests/unit/db/api/test_migrations.py | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/nova/tests/unit/db/api/test_migrations.py b/nova/tests/unit/db/api/test_migrations.py index 3b9b17aab2..7c99f2f44a 100644 --- a/nova/tests/unit/db/api/test_migrations.py +++ b/nova/tests/unit/db/api/test_migrations.py @@ -25,7 +25,6 @@ from unittest import mock from alembic import command as alembic_api from alembic import script as alembic_script -from migrate.versioning import api as migrate_api from oslo_db.sqlalchemy import enginefacade from oslo_db.sqlalchemy import test_fixtures from oslo_db.sqlalchemy import test_migrations @@ -127,47 +126,6 @@ class TestModelsSyncPostgreSQL( FIXTURE = test_fixtures.PostgresqlOpportunisticFixture -class NovaModelsMigrationsLegacySync(NovaModelsMigrationsSync): - """Test that the models match the database after old migrations are run.""" - - def db_sync(self, engine): - # the 'nova.db.migration.db_sync' method will not use the legacy - # sqlalchemy-migrate-based migration flow unless the database is - # already controlled with sqlalchemy-migrate, so we need to manually - # enable version controlling with this tool to test this code path - repository = migration._find_migrate_repo(database='api') - migrate_api.version_control( - engine, repository, migration.MIGRATE_INIT_VERSION['api']) - - # now we can apply migrations as expected and the legacy path will be - # followed - super().db_sync(engine) - - -class TestModelsLegacySyncSQLite( - NovaModelsMigrationsLegacySync, - test_fixtures.OpportunisticDBTestMixin, - testtools.TestCase, -): - pass - - -class TestModelsLegacySyncMySQL( - NovaModelsMigrationsLegacySync, - test_fixtures.OpportunisticDBTestMixin, - testtools.TestCase, -): - FIXTURE = test_fixtures.MySQLOpportunisticFixture - - -class TestModelsLegacySyncPostgreSQL( - NovaModelsMigrationsLegacySync, - test_fixtures.OpportunisticDBTestMixin, - testtools.TestCase, -): - FIXTURE = test_fixtures.PostgresqlOpportunisticFixture - - class NovaMigrationsWalk( test_fixtures.OpportunisticDBTestMixin, test.NoDBTestCase, ): @@ -180,7 +138,7 @@ class NovaMigrationsWalk( super().setUp() self.engine = enginefacade.writer.get_engine() self.config = migration._find_alembic_conf('api') - self.init_version = migration.ALEMBIC_INIT_VERSION['api'] + self.init_version = 'd67eeaabee36' def _migrate_up(self, connection, revision): if revision == self.init_version: # no tests for the initial revision |