When I run local unit tests using `tox -e py27` from master branch, get 3 tests fail related with database API testcases. See the following logs for more details.
Traceback (most recent call last):
File "barbican/model/repositories.py", line 410, in create_from
entity.save(session=session)
File "barbican/model/models.py", line 119, in save
session.flush()
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2139, in flush
self._flush(objects)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2259, in _flush
transaction.rollback(_capture_exception=True)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2223, in _flush
flush_context.execute()
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
rec.execute(self)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
uow
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
mapper, table, insert)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 835, in _emit_insert_statements
execute(statement, params)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
context)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
IntegrityError: (sqlite3.IntegrityError) column project_id is not unique [SQL: u'INSERT INTO project_secret_store (id, created_at, updated_at, deleted_at, deleted, status, secret_store_id, project_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('685a2fd4-228e-465a-a794-a5f6ac82e714', '2017-04-12 02:22:51.250918', '2017-04-12 02:22:51.250918', None, 0, 'ACTIVE', u'd501ab9c-baa6-4731-b566-3331933638c4', u'f89919e3-0041-4a55-9c6e-b5d0f9fc1ce7')]
}}}
Traceback (most recent call last):
File "barbican/tests/model/repositories/test_repositories_secret_stores.py", line 316, in test_do_entity_name
self.assertIn("UNIQUE constraint", ex.message)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 417, in assertIn
self.assertThat(haystack, Contains(needle), message)
File "/root/git.openstack.org/barbican/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
raise mismatch_error
testtools.matchers._impl.MismatchError: 'UNIQUE constraint' not in u"A defined SQL constraint check failed: 'column project_id is not unique',"
2017-04-11 19:22:55.304 DEBUG barbican.api.middleware.simple [req-351b9920-6a9f-45d4-8a91-e6ca02c2c828 None None] Calling SimpleFilter from (pid=84430) process_request barbican/api/middleware/simple.py:34
Ran 1435 (+626) tests in 65.067s (-726.147s)
FAILED (id=72, failures=3 (-28), skips=4)
error: testr failed (1)
I'm using centos7.2.1511 and python 2.7.5. Not sure whether this is related with my local environment.
Also I get different test results when testing this patch https://review.openstack.org/#/c/445722/ - my local py27 test runs successfully while the community py27 test fails.
Looking forward to your comments !
Fix proposed to branch: master /review. openstack. org/457625
Review: https:/