]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Update template for ModelMigrationSync test
authorAKamyshnikova <akamyshnikova@mirantis.com>
Thu, 27 Aug 2015 07:53:26 +0000 (10:53 +0300)
committerAKamyshnikova <akamyshnikova@mirantis.com>
Thu, 27 Aug 2015 07:56:12 +0000 (10:56 +0300)
Add some more useful details in template and update contribute.rst
with link for template.

Related-bug: #1470678

Change-Id: I8785129ba85236220650b2ba7ec0bc605847b1b7

doc/source/devref/contribute.rst
doc/source/devref/template_model_sync_test.rst

index d10cd2a1ebff930523a9aa70a5f1758c268deffe..1ba7adaffefe83120db6d9291a330d3c4defe9ab 100644 (file)
@@ -452,7 +452,7 @@ DB Model/Migration Testing
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Here is a `template functional test
-<https://bugs.launchpad.net/neutron/+bug/1470678>`_ (TODO:Ann) third-party
+<http://docs.openstack.org/developer/neutron/devref/template_model_sync_test.html>`_ 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.
index 96e59aa14a17d9c5e94ded04c8d2d347489728cf..43f7b87c1109625744cf420bb02e01c1f5ea6d4c 100644 (file)
@@ -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: