From 15b9e81d37d1adaf5a13be68d12c1544405488e3 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Fri, 31 May 2019 13:41:11 +0200 Subject: [PATCH] Simplfy test setup for TestNovaMigrations* tests The NoDBTestCase base class does a lot of env setup that is not needed for these tests. As we have issues with these tests (see bug 1823251) this patch tries to decrease the complexity of them to help the troubleshooting. Change-Id: I46fafa470b9d378d96c0f364e9b487742bf58cb2 Related-Bug: #1823251 --- nova/tests/functional/db/api/test_migrations.py | 7 ++++--- nova/tests/unit/db/test_migrations.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nova/tests/functional/db/api/test_migrations.py b/nova/tests/functional/db/api/test_migrations.py index 6130cc3adf98..770c5fa6f3f9 100644 --- a/nova/tests/functional/db/api/test_migrations.py +++ b/nova/tests/functional/db/api/test_migrations.py @@ -39,6 +39,7 @@ from oslo_db.sqlalchemy import utils as db_utils from oslo_serialization import jsonutils import sqlalchemy from sqlalchemy.engine import reflection +import testtools from nova.db import migration from nova.db.sqlalchemy.api_migrations import migrate_repo @@ -128,18 +129,18 @@ class NovaAPIModelsSync(test_migrations.ModelsMigrationsSync): class TestNovaAPIMigrationsSQLite(NovaAPIModelsSync, test_fixtures.OpportunisticDBTestMixin, - test.NoDBTestCase): + testtools.TestCase): pass class TestNovaAPIMigrationsMySQL(NovaAPIModelsSync, test_fixtures.OpportunisticDBTestMixin, - test.NoDBTestCase): + testtools.TestCase): FIXTURE = test_fixtures.MySQLOpportunisticFixture class TestNovaAPIMigrationsPostgreSQL(NovaAPIModelsSync, - test_fixtures.OpportunisticDBTestMixin, test.NoDBTestCase): + test_fixtures.OpportunisticDBTestMixin, testtools.TestCase): FIXTURE = test_fixtures.PostgresqlOpportunisticFixture diff --git a/nova/tests/unit/db/test_migrations.py b/nova/tests/unit/db/test_migrations.py index a6503eadc9fb..9a8998413dd8 100644 --- a/nova/tests/unit/db/test_migrations.py +++ b/nova/tests/unit/db/test_migrations.py @@ -46,6 +46,7 @@ import sqlalchemy from sqlalchemy.engine import reflection import sqlalchemy.exc from sqlalchemy.sql import null +import testtools from nova.db import migration from nova.db.sqlalchemy import migrate_repo @@ -1024,13 +1025,13 @@ class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync, class TestNovaMigrationsSQLite(NovaMigrationsCheckers, test_fixtures.OpportunisticDBTestMixin, - test.NoDBTestCase): + testtools.TestCase): pass class TestNovaMigrationsMySQL(NovaMigrationsCheckers, test_fixtures.OpportunisticDBTestMixin, - test.NoDBTestCase): + testtools.TestCase): FIXTURE = test_fixtures.MySQLOpportunisticFixture def test_innodb_tables(self): @@ -1058,7 +1059,7 @@ class TestNovaMigrationsMySQL(NovaMigrationsCheckers, class TestNovaMigrationsPostgreSQL(NovaMigrationsCheckers, test_fixtures.OpportunisticDBTestMixin, - test.NoDBTestCase): + testtools.TestCase): FIXTURE = test_fixtures.PostgresqlOpportunisticFixture