diff options
author | Zuul <zuul@review.opendev.org> | 2023-04-17 01:08:26 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-04-17 01:08:26 +0000 |
commit | 01ffb6df85ad895bfe94cc46a3be958dbd266a7a (patch) | |
tree | 9342b5e777137d0c628c398b5f8e42fda6310341 /nova/tests/unit/db/api/test_migrations.py | |
parent | a5245da25c0f55cffd59b254581bc05237d9c93d (diff) | |
parent | fd39e4b4be9ddb18b96d5f8086955b91232f25e9 (diff) | |
download | nova-01ffb6df85ad895bfe94cc46a3be958dbd266a7a.tar.gz |
Merge "db: Remove legacy migrations"
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 |