From: AKamyshnikova Date: Thu, 27 Aug 2015 07:53:26 +0000 (+0300) Subject: Update template for ModelMigrationSync test X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4d1febcb16c47707fe2eadae670f2ada8c0408df;p=openstack-build%2Fneutron-build.git Update template for ModelMigrationSync test Add some more useful details in template and update contribute.rst with link for template. Related-bug: #1470678 Change-Id: I8785129ba85236220650b2ba7ec0bc605847b1b7 --- diff --git a/doc/source/devref/contribute.rst b/doc/source/devref/contribute.rst index d10cd2a1e..1ba7adaff 100644 --- a/doc/source/devref/contribute.rst +++ b/doc/source/devref/contribute.rst @@ -452,7 +452,7 @@ DB Model/Migration Testing ~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is a `template functional test -`_ (TODO:Ann) third-party +`_ third-party maintainers can use to develop tests for model-vs-migration sync in their repos. It is recommended that each third-party CI sets up such a test, and runs it regularly against Neutron master. diff --git a/doc/source/devref/template_model_sync_test.rst b/doc/source/devref/template_model_sync_test.rst index 96e59aa14..43f7b87c1 100644 --- a/doc/source/devref/template_model_sync_test.rst +++ b/doc/source/devref/template_model_sync_test.rst @@ -86,6 +86,11 @@ names, which were moved out of Neutron: :: + REPO_ARISTA_TABLES + REPO_CISCO_TABLES) +Also the test uses **VERSION_TABLE**, it is the name of table in database which +contains revision id of head migration. It is preferred to keep this variable in +``networking_foo/db/migration/alembic_migrations/__init__.py`` so it will be easy +to use in test. + Create a module ``networking_foo/tests/functional/db/test_migrations.py`` with the following content: :: @@ -96,7 +101,7 @@ with the following content: :: from neutron.tests.common import base from neutron.tests.functional.db import test_migrations - from networking_foo.db.migration.alembic_migrations import env + from networking_foo.db.migration import alembic_migrations from networking_foo.db.models import head # EXTERNAL_TABLES should contain all names of tables that are not related to @@ -118,7 +123,7 @@ with the following content: :: def include_object(self, object_, name, type_, reflected, compare_to): if type_ == 'table' and (name == 'alembic' or - name == env.VERSION_TABLE or + name == alembic_migrations.VERSION_TABLE or name in EXTERNAL_TABLES): return False else: