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
changes/34/662434/2
Balazs Gibizer 4 years ago
parent 6e4ab9714c
commit 15b9e81d37
  1. 7
      nova/tests/functional/db/api/test_migrations.py
  2. 7
      nova/tests/unit/db/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

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

Loading…
Cancel
Save