New mock release(1.1.0) broke unit/function tests

Bug #1473454 reported by Rico Lin on 2015-07-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Gorka Eguileor
Glance Client
Undecided
Rico Lin
OpenStack DBaaS (Trove)
High
Nikhil Manchanda
Solum
Undecided
Unassigned
python-barbicanclient
Fix Released
Undecided
Rico Lin
python-cinderclient
Undecided
Rico Lin
python-cueclient
High
Min Pae
python-muranoclient
Undecided
Unassigned
python-novaclient
Undecided
Unassigned
python-openstackclient
Fix Released
Medium
Steve Martinelli
python-solumclient
Undecided
Rico Lin

Bug Description

Ref http://lists.openstack.org/pipermail/openstack-dev/2015-July/069156.html

The newest mock release broke both our unit and our functional tests. Luckily, there's no major regression and we'd only have to fix the invoking of assert_called_once_with everywhere and actually make sure the test passes.

Rico Lin (rico-lin) on 2015-07-10
Changed in cinder:
assignee: nobody → Rico Lin (rico-lin)
summary: - New mock release(1.1.0) broke unit tests
+ New mock release(1.1.0) broke unit/function tests
affects: cinder → python-cinderclient
Changed in cinder:
assignee: nobody → Rico Lin (rico-lin)
Eric Harney (eharney) wrote :

This also means we'll be able to remove N327 from our hacking checks.

Gorka Eguileor (gorka) wrote :

I already have a working patch https://review.openstack.org/#/c/200484/

Changed in cinder:
assignee: Rico Lin (rico-lin) → Gorka Eguileor (gorka)
Changed in cinder:
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-10
Changed in python-cinderclient:
status: New → Confirmed

Related fix proposed to branch: master
Review: https://review.openstack.org/200562

Changed in python-cinderclient:
status: Confirmed → In Progress
Rico Lin (rico-lin) on 2015-07-10
Changed in python-novaclient:
assignee: nobody → Rico Lin (rico-lin)
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-10
Changed in python-novaclient:
status: In Progress → Invalid
Changed in mistral:
assignee: nobody → Rico Lin (rico-lin)
Changed in python-novaclient:
assignee: Rico Lin (rico-lin) → nobody

Fix proposed to branch: master
Review: https://review.openstack.org/200584

Changed in mistral:
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-10
Changed in python-glanceclient:
assignee: nobody → Rico Lin (rico-lin)

Fix proposed to branch: master
Review: https://review.openstack.org/200685

Changed in python-glanceclient:
status: New → In Progress

Reviewed: https://review.openstack.org/200484
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=0f588ac59b998a8a12457ffdca87292d67a0584a
Submitter: Jenkins
Branch: master

commit 0f588ac59b998a8a12457ffdca87292d67a0584a
Author: Gorka Eguileor <email address hidden>
Date: Fri Jul 10 13:20:16 2015 +0200

    Fix tests failing in gate

    gate-cinder-python27 gate-cinder-python34 is reporting failures where it
    wasn't before. This is all due to new mock version 1.1.0. This patch
    fixed the tests to pass the gate.

    Some of these errors are actual errors in our test code, while other are
    changes to Mock syntax.

    Closes-Bug: #1473454
    Change-Id: If8eabfeacacc221e92dfece9f4937875bd70751e

Changed in cinder:
status: In Progress → Fix Committed
Rico Lin (rico-lin) on 2015-07-11
Changed in trove:
assignee: nobody → Rico Lin (rico-lin)
Rico Lin (rico-lin) on 2015-07-11
Changed in trove:
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-11
Changed in python-barbicanclient:
assignee: nobody → Rico Lin (rico-lin)

Fix proposed to branch: master
Review: https://review.openstack.org/200792

Changed in python-barbicanclient:
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-11
Changed in python-muranoclient:
assignee: nobody → Rico Lin (rico-lin)
Rico Lin (rico-lin) on 2015-07-11
Changed in python-muranoclient:
status: New → Invalid
Rico Lin (rico-lin) on 2015-07-11
Changed in python-openstackclient:
assignee: nobody → Rico Lin (rico-lin)

Fix proposed to branch: master
Review: https://review.openstack.org/200797

Changed in python-openstackclient:
status: New → In Progress
Changed in trove:
importance: Undecided → High
milestone: none → liberty-2
Rico Lin (rico-lin) on 2015-07-11
Changed in python-muranoclient:
assignee: Rico Lin (rico-lin) → nobody
Rico Lin (rico-lin) on 2015-07-11
Changed in python-solumclient:
assignee: nobody → Rico Lin (rico-lin)

Fix proposed to branch: master
Review: https://review.openstack.org/200802

Changed in python-solumclient:
status: New → In Progress
Rico Lin (rico-lin) on 2015-07-11
Changed in solum:
assignee: nobody → Rico Lin (rico-lin)
Rico Lin (rico-lin) on 2015-07-11
Changed in solum:
assignee: Rico Lin (rico-lin) → nobody

Reviewed: https://review.openstack.org/200792
Committed: https://git.openstack.org/cgit/openstack/python-barbicanclient/commit/?id=1006223a1f5d928d475d057401cba5231bbfb1a6
Submitter: Jenkins
Branch: master

commit 1006223a1f5d928d475d057401cba5231bbfb1a6
Author: rico.lin <email address hidden>
Date: Sat Jul 11 13:20:24 2015 +0800

    New mock release(1.1.0) broke unit/function tests

    Change-Id: Ife0ff0789e6360d405dd371902c88b6819c48d7f
    Closes-Bug: #1473454

Changed in python-barbicanclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
status: In Progress → Fix Committed

Reviewed: https://review.openstack.org/200685
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=e976032a95962d6f6c750a7812ffda155492bc73
Submitter: Jenkins
Branch: master

commit e976032a95962d6f6c750a7812ffda155492bc73
Author: rico.lin <email address hidden>
Date: Sat Jul 11 03:14:05 2015 +0800

    Remove usage of assert_called_once on Mock objects

    mock 1.1.0 was released on 10 July 2015 which prevents users from using
    non-existent assertion methods. This broke the test in the diff.

    Co-Authored-By: Ian Cordasco <email address hidden>
    Closes-Bug: #1473454
    Change-Id: I162b76bbd7d96c96787a8dd8f9642ca1c80c596a

Change abandoned by Rico Lin (<email address hidden>) on branch: master
Review: https://review.openstack.org/200797

Reviewed: https://review.openstack.org/200402
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=f807f0a66e2d53b6711937a3687d44f11dc1d6fd
Submitter: Jenkins
Branch: master

commit f807f0a66e2d53b6711937a3687d44f11dc1d6fd
Author: lin-hua-cheng <email address hidden>
Date: Fri Jul 10 00:11:18 2015 -0700

    Fix wrong mock method call

    There is no assert_called() method in mock, replace it with
    assert_called_with() method. The old method used to work with
    mock 1.0.1 because it was a noop in magicmock.

    Needs https://review.openstack.org/#/c/200583 to pass the requirements check.

    https://review.openstack.org/#/c/193935/ changed the OS_* vars
    we source by forcing v2password as the auth method.
    change our identity v3 test setup by setting v3password

    Co-Authored-By: Steve Martinelli <email address hidden>

    Closes-Bug: 1473454

    Depends-on: I0cfab6d13e5d9e744cb302c86a2c21269923e75d

    Change-Id: Id22765c7e044797e03d19ad1b103fadec2726aa2

Changed in python-openstackclient:
status: In Progress → Fix Committed
Changed in python-openstackclient:
assignee: Rico Lin (rico-lin) → Steve Martinelli (stevemar)
importance: Undecided → Medium

Reviewed: https://review.openstack.org/200562
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ee6576c4eb7bf031d6728d57db4a649d5c39243f
Submitter: Jenkins
Branch: master

commit ee6576c4eb7bf031d6728d57db4a649d5c39243f
Author: Eric Harney <email address hidden>
Date: Fri Jul 10 10:25:50 2015 -0400

    Remove hacking check N327

    With mock 1.1.0+, mock will fail when nonexistent
    methods are called, so this check is no longer
    necessary.

    Related-Bug: #1473454

    Change-Id: I9cb8b4a5eab78e51728aa8f83668f5979c0b9be1

Reviewed: https://review.openstack.org/200584
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=fc12522730505f1c6ac6c0fbf70cc2671079f267
Submitter: Jenkins
Branch: master

commit fc12522730505f1c6ac6c0fbf70cc2671079f267
Author: rico.lin <email address hidden>
Date: Fri Jul 10 23:24:30 2015 +0800

    New mock release(1.1.0) broke unit/function tests

    Change-Id: I14e3be3f188a7f1f4a0a3b688c1343996bd85de0
    Closes-Bug: #1473454

Changed in mistral:
status: In Progress → Fix Committed

Reviewed: https://review.openstack.org/200802
Committed: https://git.openstack.org/cgit/stackforge/python-solumclient/commit/?id=fbd9627b8199f565cc4ff4caf3c6c32067eae88b
Submitter: Jenkins
Branch: master

commit fbd9627b8199f565cc4ff4caf3c6c32067eae88b
Author: rico.lin <email address hidden>
Date: Sat Jul 11 15:31:56 2015 +0800

    New mock release(1.1.0) broke unit/function tests

    Change-Id: Idf29402f4c26e533cdc9a5fa39cdd6223a749be0
    Closes-Bug: #1473454

Changed in python-solumclient:
status: In Progress → Fix Committed
Changed in trove:
assignee: Rico Lin (rico-lin) → Nikhil Manchanda (slicknik)
Vipul Sabhaya (vipuls) on 2015-07-13
Changed in python-cueclient:
assignee: nobody → Min Pae (sputnik13)
status: New → Confirmed
Min Pae (sputnik13) on 2015-07-13
Changed in python-cueclient:
importance: Undecided → High
Min Pae (sputnik13) wrote :

python-cueclient is not breaking from the mock change, it only instantiates a Mock and does not use the assert calls in the Mock.

Changed in python-cueclient:
status: Confirmed → Invalid

Reviewed: https://review.openstack.org/200791
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=f9b0a3a9689859414a99aa2adbeae3697bdcbae5
Submitter: Jenkins
Branch: master

commit f9b0a3a9689859414a99aa2adbeae3697bdcbae5
Author: rico.lin <email address hidden>
Date: Sat Jul 11 12:54:26 2015 +0800

    Fix unit test mocks for new mock release

    The new mock release(1.1.0) broke some of the unit tests which
    were using incorrect mock methods that do not really exist.

    Before mock 1.1.0 using such incorrectly mocked methds would
    silently pass -- but after the upgrade these (rightly) cause
    errors that need to be fixed.

    Change-Id: I35fbd142a199f5e5f39b7835fee0ac888dc9784b
    Closes-Bug: 1473454

Changed in trove:
status: In Progress → Fix Committed

Reviewed: https://review.openstack.org/201505
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=9697376e2c4f4b1b4fc2529fae8232326125f6df
Submitter: Jenkins
Branch: stable/kilo

commit 9697376e2c4f4b1b4fc2529fae8232326125f6df
Author: rico.lin <email address hidden>
Date: Fri Jul 10 23:24:30 2015 +0800

    New mock release(1.1.0) broke unit/function tests

    Change-Id: I14e3be3f188a7f1f4a0a3b688c1343996bd85de0
    Closes-Bug: #1473454
    (cherry picked from commit fc12522730505f1c6ac6c0fbf70cc2671079f267)

tags: added: in-stable-kilo

Reviewed: https://review.openstack.org/200563
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=953f76650e084f5678efb5529d00b3b4b79eb2ff
Submitter: Jenkins
Branch: master

commit 953f76650e084f5678efb5529d00b3b4b79eb2ff
Author: rico.lin <email address hidden>
Date: Fri Jul 10 22:28:49 2015 +0800

    New mock release(1.1.0) broke unit/function tests

    Change-Id: Ia84c667b65fb69ba877bdb0ecb45827281539e03
    Closes-Bug: #1473454

Changed in python-cinderclient:
status: In Progress → Fix Committed
Changed in mistral:
importance: Undecided → High
milestone: none → liberty-2
Thierry Carrez (ttx) on 2015-07-28
Changed in trove:
status: Fix Committed → Fix Released
Changed in cinder:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Changed in python-openstackclient:
milestone: none → 1.6.0
status: Fix Committed → Fix Released
no longer affects: mistral

Reviewed: https://review.openstack.org/202015
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=3b111f98b7043d2e126ab234e0bf17b59751069d
Submitter: Jenkins
Branch: stable/kilo

commit 3b111f98b7043d2e126ab234e0bf17b59751069d
Author: Nikhil Manchanda <email address hidden>
Date: Sat Jul 11 12:54:26 2015 +0800

    Fix unit test mocks for new mock release

    The new mock release(1.1.0) broke some of the unit tests which
    were using incorrect mock methods that do not really exist.

    Before mock 1.1.0 using such incorrectly mocked methods would
    silently pass -- but after the upgrade these (rightly) cause
    errors that need to be fixed.

    Change-Id: I35fbd142a199f5e5f39b7835fee0ac888dc9784b
    Closes-Bug: 1473454

Changed in python-barbicanclient:
milestone: none → 3.3.0
status: Fix Committed → Fix Released
Changed in python-glanceclient:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
Changed in python-cinderclient:
milestone: none → 1.4.0
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-10-15
Changed in trove:
milestone: liberty-2 → 4.0.0
Thierry Carrez (ttx) on 2015-10-15
Changed in cinder:
milestone: liberty-2 → 7.0.0

This issue was fixed in the openstack/python-barbicanclient 3.3.0 release.

This issue was fixed in the openstack/python-cinderclient 1.4.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers