Bug 1592127

Summary: python-alembic FTBFS
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-alembicAssignee: Fedora Infrastructure SIG <infra-sig>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: rawhideCC: infra-sig, mbayer, rbean
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-alembic-0.9.7-6.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-19 20:29:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1565020    
Attachments:
Description Flags
build.log from Koji (Python 3.7)
none
root.log from Koji (Python 3.7)
none
root.log from Koji (Python 3.6)
none
root.log from Koji (Python 3.6) none

Description Miro Hrončok 2018-06-17 14:50:52 UTC
Created attachment 1452387 [details]
build.log from Koji (Python 3.7)

python-alembic-0.9.7-5.fc29 fails to build on rawhide in the Python 3.7 side tag (f29-python).

=================================== FAILURES ===================================
__________ OpTest.test_alter_column_schema_schema_type_existing_type ___________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 389, in test_alter_column_schema_schema_type_existing_type
    'ALTER TABLE foo.t ALTER COLUMN c VARCHAR(10)'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE foo.t ALTER COLUMN c VARCHAR(10)'] != ['ALTER TABLE foo.t DROP CONSTRAINT xyz', 'ALTER TABLE foo.t ALTER COLUMN c VARCHAR(10)']
______________ OpTest.test_alter_column_schema_schema_type_named _______________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 371, in test_alter_column_schema_schema_type_named
    'ALTER TABLE foo.t ADD CONSTRAINT xyz CHECK (c IN (0, 1))'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE foo.t ALTER COLUMN c BIT'] != ['ALTER TABLE foo.t ALTER COLUMN c BIT', 'ALTER TABLE foo.t ADD CONSTRAINT xyz CHECK (c IN (0, 1))']
_____________ OpTest.test_alter_column_schema_schema_type_unnamed ______________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 355, in test_alter_column_schema_schema_type_unnamed
    'ALTER TABLE foo.t ADD CHECK (c IN (0, 1))'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE foo.t ALTER COLUMN c BIT'] != ['ALTER TABLE foo.t ALTER COLUMN c BIT', 'ALTER TABLE foo.t ADD CHECK (c IN (0, 1))']
______________ OpTest.test_alter_column_schema_type_existing_type ______________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 380, in test_alter_column_schema_type_existing_type
    'ALTER TABLE t ALTER COLUMN c VARCHAR(10)'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE t ALTER COLUMN c VARCHAR(10)'] != ['ALTER TABLE t DROP CONSTRAINT xyz', 'ALTER TABLE t ALTER COLUMN c VARCHAR(10)']
__________________ OpTest.test_alter_column_schema_type_named __________________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 363, in test_alter_column_schema_type_named
    'ALTER TABLE t ADD CONSTRAINT xyz CHECK (c IN (0, 1))'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE t ALTER COLUMN c BIT'] != ['ALTER TABLE t ALTER COLUMN c BIT', 'ALTER TABLE t ADD CONSTRAINT xyz CHECK (c IN (0, 1))']
_________________ OpTest.test_alter_column_schema_type_unnamed _________________
Traceback (most recent call last):
  File "/builddir/build/BUILD/alembic-0.9.7/tests/test_op.py", line 347, in test_alter_column_schema_type_unnamed
    'ALTER TABLE t ADD CHECK (c IN (0, 1))'
  File "/builddir/build/BUILD/alembic-0.9.7/alembic/testing/fixtures.py", line 130, in assert_
    eq_(buf.lines, list(sql))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/testing/assertions.py", line 222, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: [u'ALTER TABLE t ALTER COLUMN c BIT'] != ['ALTER TABLE t ALTER COLUMN c BIT', 'ALTER TABLE t ADD CHECK (c IN (0, 1))']
=========================== short test summary info ============================
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_schema_type_existing_type
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_schema_type_named
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_schema_type_unnamed
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_type_existing_type
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_type_named
FAIL tests/test_op.py::OpTest::()::test_alter_column_schema_type_unnamed
============== 6 failed, 885 passed, 213 skipped in 36.60 seconds ==============

This is a Python 2 test failure!

Comment 1 Miro Hrončok 2018-06-17 14:52:40 UTC
Created attachment 1452388 [details]
root.log from Koji (Python 3.7)

Comment 2 Miro Hrončok 2018-06-17 14:53:08 UTC
Created attachment 1452389 [details]
root.log from Koji (Python 3.6)

Comment 3 Miro Hrončok 2018-06-17 14:53:56 UTC
Failed (f29-python side tag): https://koji.fedoraproject.org/koji/taskinfo?taskID=27674355
Passed (normal rawhide): https://koji.fedoraproject.org/koji/taskinfo?taskID=27674705

Comment 4 Miro Hrončok 2018-06-17 14:56:55 UTC
Created attachment 1452390 [details]
root.log from Koji (Python 3.6)

(uploaded wrong one before)

Comment 5 Miro Hrončok 2018-06-17 14:58:31 UTC
Might be because of python3-sqlalchemy 1.2.8.

Comment 6 Miro Hrončok 2018-06-17 16:34:23 UTC
Update to alembic 0.9.9 does not solve this.

Comment 7 Miro Hrončok 2018-06-19 06:23:41 UTC
This is blocking bodhi and hence fedpkg. It's blocking the side tag merge.

Comment 8 Michael Bayer 2018-06-19 19:57:29 UTC
I'm a little confused that log at https://bugzilla.redhat.com/attachment.cgi?id=1452387 shows:

+ /usr/bin/python2 setup.py test


but...I am seeing something with Alembic 0.9.9 that I don't see with unreleased 0.9.10, am investigating.

Comment 9 Michael Bayer 2018-06-19 20:06:03 UTC
okey doke this is the commit you need to patch into your .spec for now until I release alembic 0.9.10:

https://github.com/zzzeek/alembic/commit/0f87fecb

diff --git a/alembic/testing/fixtures.py b/alembic/testing/fixtures.py
index e6c16dd..86d40a2 100644
--- a/alembic/testing/fixtures.py
+++ b/alembic/testing/fixtures.py
@@ -146,6 +146,9 @@ def op_fixture(
     ctx_dialect = _get_dialect(dialect)
     if native_boolean is not None:
         ctx_dialect.supports_native_boolean = native_boolean
+        # this is new as of SQLAlchemy 1.2.7 and is used by SQL Server,
+        # which breaks assumptions in the alembic test suite
+        ctx_dialect.non_native_boolean_check_constraint = True
     if not as_sql:
         def execute(stmt, *multiparam, **param):
             if isinstance(stmt, string_types):




you need that with SQLAlchemy 1.2.7 and above, upstream the issue is addressed in https://github.com/zzzeek/sqlalchemy/commit/bd1d6012dcbe5fbc6d1097a79d85b972b0d4fd8a

Comment 10 Miro Hrončok 2018-06-19 20:10:26 UTC
Michael, thank you.

Comment 11 Miro Hrončok 2018-06-19 20:15:12 UTC
Scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=27741521

Comment 12 Miro Hrončok 2018-06-19 20:16:42 UTC
Builds. Will push it.

Comment 13 Miro Hrončok 2018-06-19 20:29:51 UTC
Real build: https://koji.fedoraproject.org/koji/taskinfo?taskID=27741809

Comment 14 Ralph Bean 2018-06-19 20:58:31 UTC
Teamwork makes the dream work.  Thanks both!