Unit tests fail with sqlalchemy 1.0+

Bug #1467008 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Brant Knudson
OpenStack Identity (keystone)
Fix Released
High
Brant Knudson
oslo.db
Invalid
Undecided
Unassigned

Bug Description

Unit tests fail with sqlalchemy 1.0+. See https://review.openstack.org/#/c/190405/ , which tries to upgrade the requirement and fails.

2015-06-16 19:32:44.080 | keystone.tests.unit.test_sql_upgrade.SqlUpgradeTests.test_region_url_upgrade
2015-06-16 19:32:44.080 | ----------------------------------------------------------------------------
2015-06-16 19:32:44.080 |
2015-06-16 19:32:44.080 | Captured traceback:
2015-06-16 19:32:44.081 | ~~~~~~~~~~~~~~~~~~~
2015-06-16 19:32:44.081 | Traceback (most recent call last):
2015-06-16 19:32:44.081 | File "keystone/tests/unit/test_sql_upgrade.py", line 196, in tearDown
2015-06-16 19:32:44.081 | conn.execute(schema.DropConstraint(fkc))
2015-06-16 19:32:44.081 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
2015-06-16 19:32:44.081 | return meth(self, multiparams, params)
2015-06-16 19:32:44.081 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
2015-06-16 19:32:44.081 | return connection._execute_ddl(self, multiparams, params)
2015-06-16 19:32:44.081 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
2015-06-16 19:32:44.081 | compiled
2015-06-16 19:32:44.081 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2015-06-16 19:32:44.082 | context)
2015-06-16 19:32:44.082 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2015-06-16 19:32:44.082 | util.raise_from_cause(newraise, exc_info)
2015-06-16 19:32:44.082 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-06-16 19:32:44.082 | reraise(type(exception), exception, tb=exc_tb)
2015-06-16 19:32:44.082 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2015-06-16 19:32:44.082 | context)
2015-06-16 19:32:44.082 | File "/home/jenkins/workspace/gate-keystone-python27/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2015-06-16 19:32:44.082 | cursor.execute(statement, parameters)
2015-06-16 19:32:44.082 | sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "DROP": syntax error [SQL: u'ALTER TABLE "group" DROP CONSTRAINT fk_group_domain_id']

Brant Knudson (blk-u)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :

Old SQLAlchemy didn't return any foreign keys when you called inspector.get_foreign_keys(table_name) on sqlite. So before the test code wouldn't try to drop all foreign keys since there were none.

Now that sqlalchemy is returning foreign keys, the tests fail when they try to drop the foreign keys.

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
Brant Knudson (blk-u) wrote :
Changed in glance:
status: New → In Progress
assignee: nobody → Brant Knudson (blk-u)
Changed in oslo.db:
status: New → Incomplete
summary: - Unit tests fail with sqlalchemy 1.1.0
+ Unit tests fail with sqlalchemy 1.0+
description: updated
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Changed in keystone:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Changed in oslo.db:
status: Incomplete → Invalid
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-2 → 8.0.0
Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-2 → 11.0.0
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.