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
This commit is contained in:
Balazs Gibizer 2019-05-31 13:41:11 +02:00
parent 6e4ab9714c
commit 15b9e81d37
2 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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