Add a constraint to skip fields during model and db sync tests

Bug #1468463 reported by Sudipta Biswas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Triaged
Wishlist
Unassigned

Bug Description

We would like to drop a few columns from the Models class and subsequently identify these fields for a database removal in the next openstack ('M') release.

However In nova/tests/unit/db/test_migrations.py - there's a test that does a check between the DB schema and models.py called "test_models_sync" - that matches the models and the db schema to ensure that there's no difference between the two.

We would like to have a 'whitelist' of attributes that are identified for cleanups from the models.py that could act as a constraint while doing this models_sync test. The attributes could be called "allow_missing_from_model" or "allow_missing_from_db" that would help us get past this error in the tests and at the same time help us maintain a list of attributes - that needs cleanup from the DB in the future releases.

The test failure could be observed on this review: https://review.openstack.org/#/c/192760/

Revision history for this message
Sudipta Biswas (sbiswas7) wrote :

Here's the error trace for the UT that fails:

2015-06-24 18:29:04.042 |
2015-06-24 18:29:04.042 | Captured traceback:
2015-06-24 18:29:04.042 | ~~~~~~~~~~~~~~~~~~~
2015-06-24 18:29:04.042 | Traceback (most recent call last):
2015-06-24 18:29:04.042 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/oslo_db/sqlalchemy/test_migrations.py", line 588, in test_models_sync
2015-06-24 18:29:04.042 | "Models and migration scripts aren't in sync:\n%s" % msg)
2015-06-24 18:29:04.042 | File "/home/jenkins/workspace/gate-nova-python27/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 666, in fail
2015-06-24 18:29:04.042 | raise self.failureException(msg)
2015-06-24 18:29:04.042 | AssertionError: Models and migration scripts aren't in sync:
2015-06-24 18:29:04.042 | [ ( 'remove_column',
2015-06-24 18:29:04.043 | None,
2015-06-24 18:29:04.043 | 'instances',
2015-06-24 18:29:04.043 | Column('scheduled_at', DATETIME(), table=<instances>))]
2015-06-24 18:29:04.043 |

Changed in oslo.db:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Ann Taraday (akamyshnikova) wrote :

This would be useful for Neutron implementation as well, as we have a numbers of errors that we have to skip always https://github.com/openstack/neutron/blob/master/neutron/tests/functional/db/test_migrations.py#L184-L205

Changed in oslo.db:
assignee: nobody → Ann Kamyshnikova (akamyshnikova)
Revision history for this message
Ann Taraday (akamyshnikova) wrote :
Changed in oslo.db:
assignee: Ann Kamyshnikova (akamyshnikova) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.