Invalid bug, don't try to fix

Bug #1475722 reported by Brian Curtin on 2015-07-17
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Undecided
Unassigned
OpenStack SDK
Invalid
High
Qiming Teng
heat-cfntools
In Progress
Undecided
shizhihui
python-magnumclient
Undecided
Unassigned

Bug Description

They magically allow things to pass. This is bad.

Any usage should be replaced with the Mock class and explicit attributes should be set on it.

Brian Curtin (brian.curtin) wrote :

These exist in 84 places as of today.

Changed in python-openstacksdk:
milestone: 1.0 → none
Qiming Teng (tengqim) on 2015-11-26
Changed in python-openstacksdk:
assignee: nobody → Qiming Teng (tengqim)

Reviewed: https://review.openstack.org/250226
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=481aedc665a423081d74313bdcd074b9a6c788fc
Submitter: Jenkins
Branch: master

commit 481aedc665a423081d74313bdcd074b9a6c788fc
Author: tengqm <email address hidden>
Date: Thu Nov 26 03:30:52 2015 -0500

    Replace 'MagicMock' with 'Mock'

    This is part of an effort to replace all 'MagicMock' usage with 'Mock'.

    Change-Id: Ia0a62dd704640a1e8885856b3dd0402bafd94c86
    Partial-Bug: #1475722

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

Changed in python-openstacksdk:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/251175
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=17c5559fd6d35c5f0ed47af568ee9e66e823710e
Submitter: Jenkins
Branch: master

commit 17c5559fd6d35c5f0ed47af568ee9e66e823710e
Author: tengqm <email address hidden>
Date: Sun Nov 29 20:59:30 2015 -0500

    Replace 'MagicMock' with 'Mock'

    This is the closing part of an effort to replace all 'MagicMock' with
    'Mock'.

    Change-Id: Ib581fdb2ce62f8275834287caa76a083e64b81a5
    Closes-Bug: #1475722

Changed in python-openstacksdk:
status: In Progress → Fix Committed
Sai Kiran (saikiran) on 2016-01-28
Changed in python-openstackclient:
assignee: nobody → Sai Kiran (saikiran)

Automatically unassigning due to inactivity.

Changed in python-openstackclient:
assignee: Sai Kiran (saikiran) → nobody
Changed in python-openstackclient:
status: New → Confirmed
importance: Undecided → Wishlist
QiangTang (qtang) on 2016-09-14
Changed in python-openstackclient:
assignee: nobody → QiangTang (qtang)

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

Changed in python-openstackclient:
status: Confirmed → In Progress

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

commit bc222e97b155152be3c8cced987ef1d443076d10
Author: qtang <email address hidden>
Date: Wed Sep 14 13:27:31 2016 +0800

    Replace 'MagicMock' with 'Mock'

    Change-Id: I7aeceede6bd3cb88cf04f398454f9758dbee20f1
    Closes-Bug: #1475722

Changed in python-openstackclient:
status: In Progress → Fix Released
lilintan (lilintan) on 2016-09-21
Changed in neutron:
assignee: nobody → lilintan (lilintan)
no longer affects: neutron
Changed in python-neutronclient:
assignee: nobody → lilintan (lilintan)

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

Changed in python-neutronclient:
status: New → In Progress
Changed in python-neutronclient:
importance: Undecided → Low
jian.song (jiansong) on 2016-09-21
Changed in python-troveclient:
assignee: nobody → jian.song (jiansong)
Hanxi Liu (hanxi-liu) on 2016-09-21
Changed in ceilometer:
assignee: nobody → Hanxi Liu (hanxi-liu)
Changed in python-ceilometerclient:
assignee: nobody → Hanxi Liu (hanxi-liu)

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

Changed in python-troveclient:
status: New → In Progress
Changed in mistral:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in python-mistralclient:
assignee: nobody → Sharat Sharma (sharat-sharma)
jian.song (jiansong) on 2016-09-21
Changed in trove:
assignee: nobody → jian.song (jiansong)
LiuNanke (nanke-liu) on 2016-09-21
Changed in murano:
assignee: nobody → LiuNanke (nanke-liu)
LiuNanke (nanke-liu) on 2016-09-21
Changed in keystone:
assignee: nobody → LiuNanke (nanke-liu)
Changed in python-muranoclient:
assignee: nobody → LiuNanke (nanke-liu)

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

Changed in python-muranoclient:
status: New → In Progress
Changed in murano:
status: New → In Progress

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

Changed in mistral:
status: New → In Progress
liuwei (liu-wei81) on 2016-09-21
Changed in heat:
assignee: nobody → liuwei (liu-wei81)
Changed in python-heatclient:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in swift:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in python-swiftclient:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in horizon:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in rally:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in cinder:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)

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

Changed in horizon:
status: New → In Progress
Changed in python-swiftclient:
status: New → In Progress
Changed in python-mistralclient:
status: New → In Progress
Changed in glance:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)

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

Changed in python-heatclient:
status: New → In Progress
sonu (sonu-bhumca11) on 2016-09-21
Changed in designate:
assignee: nobody → sonu (sonu-bhumca11)
Changed in barbican:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in panko:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)
Changed in aodh:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)

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

Changed in barbican:
status: New → In Progress
Changed in python-barbicanclient:
assignee: nobody → Sharat Sharma (sharat-sharma)

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

Changed in python-barbicanclient:
status: New → In Progress
Changed in tempest:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in nova:
assignee: nobody → Sharat Sharma (sharat-sharma)
LiuNanke (nanke-liu) on 2016-09-21
Changed in keystonemiddleware:
assignee: nobody → LiuNanke (nanke-liu)
Changed in python-novaclient:
assignee: nobody → Sharat Sharma (sharat-sharma)
Thomas Herve (therve) on 2016-09-21
no longer affects: heat

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

Changed in keystone:
status: New → In Progress
QiangTang (qtang) on 2016-09-21
Changed in neutron:
assignee: nobody → QiangTang (qtang)

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

Changed in keystonemiddleware:
status: New → In Progress
liwei (wei-li) on 2016-09-21
no longer affects: glance-store
Lu lei (lei-lu) on 2016-09-21
Changed in senlin:
assignee: nobody → Lu lei (lei-lu)
Changed in python-senlinclient:
assignee: nobody → Lu lei (lei-lu)
Lu lei (lei-lu) on 2016-09-21
Changed in tacker:
assignee: nobody → Lu lei (lei-lu)
sonu (sonu-bhumca11) on 2016-09-21
Changed in python-designateclient:
assignee: nobody → sonu (sonu-bhumca11)

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

Changed in neutron:
status: New → In Progress
Changed in oslo.log:
assignee: nobody → ZTE-Zhengwei Su (su-zhengwei)
Changed in oslo.service:
assignee: nobody → ZTE-Zhengwei Su (su-zhengwei)

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

Changed in aodh:
status: New → In Progress

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

Changed in designate:
status: New → In Progress
Changed in oslo.messaging:
assignee: nobody → ZTE-Zhengwei Su (su-zhengwei)

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

Changed in panko:
status: New → In Progress
Changed in python-glanceclient:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)

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

Changed in nova:
status: New → In Progress
Changed in python-novaclient:
status: New → In Progress

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

Changed in python-glanceclient:
status: New → In Progress
Changed in ironic:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in python-aodhclient:
assignee: nobody → Wenyan Zhang (zhang-wenyan3)

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

Changed in ironic:
status: New → In Progress

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

Hi

what exactly is the issue here?

also is there any checks available for this to avoid regression?

It is failing while we use Mock

for e.g

x = mock.MagicMock(tst='abc')
>>> x[0]

>>> x = mock.Mock(tst='abc')

>>> x[0]
Traceback (most recent call last):
  File "", line 1, in
TypeError: 'Mock' object does not support indexing

guo yunxian (guoyunxian) on 2016-09-21
Changed in kolla:
assignee: nobody → guo yunxian (guoyunxian)
gordon chung (chungg) wrote :

removing all telemetry related projects. can we please stop creating these copy/paste bugs and adding all projects. i don't want to get emails on every single update unrelated to projects i care about.

please reopen bugs individually with less generic explanation/description.

gordon chung (chungg) wrote :

awesome. can't remove projects because there are so many projects it times out. sigh.

Brian Curtin (brian.curtin) wrote :

I have no idea what you people are doing. This was for openstacksdk and was solved a while ago.

Gordon, I'll see if I can remove things that look like telemetry.

Brian Curtin (brian.curtin) wrote :

Apparently I can't do anything about it either, so unsubscribing from the bug email.

gordon chung (chungg) wrote :

good idea. thanks for trying Brian.

Sean Dague (sdague) wrote :

To all contributors to this bug. While this looks like helping, it is not. This kind of bug is largely a waste of time.

Before adding more than 4 projects to a bug, please email the openstack-dev mailing list and ensure this is actually a cross cutting issue that people actually believe should be fixed. This just causes busy work for projects, is not helpful.

no longer affects: nova
no longer affects: keystone
no longer affects: trove
no longer affects: horizon
no longer affects: tempest
no longer affects: barbican
no longer affects: ceilometer
no longer affects: designate
no longer affects: neutron
no longer affects: oslo.log
no longer affects: oslo.service
no longer affects: ironic
no longer affects: python-barbicanclient
no longer affects: python-designateclient
no longer affects: python-aodhclient
no longer affects: python-ceilometerclient
Sean Dague (sdague) wrote :

I have deleted every project I had authority to for this bug. Please do not add any projects to this specific bug unless you've gotten acknowledgement that the project team believes this is a bug in their project.

no longer affects: aodh
no longer affects: python-glanceclient
no longer affects: python-heatclient
no longer affects: python-novaclient
no longer affects: python-neutronclient
no longer affects: tacker
no longer affects: python-openstackclient
no longer affects: python-troveclient
no longer affects: cinder
no longer affects: glance
no longer affects: keystonemiddleware
no longer affects: oslo.messaging
Steven Dake (sdake) on 2016-09-21
no longer affects: kolla
no longer affects: murano
no longer affects: python-muranoclient

Change abandoned by Wenyan Zhang (<email address hidden>) on branch: master
Review: https://review.openstack.org/373927

no longer affects: panko
shizhihui (shizhihui) on 2016-09-22
Changed in python-heatclient:
assignee: nobody → shizhihui (shizhihui)
assignee: shizhihui (shizhihui) → nobody
assignee: nobody → shizhihui (shizhihui)
no longer affects: python-heatclient
Changed in python-heatclient:
assignee: nobody → shizhihui (shizhihui)
Lu lei (lei-lu) on 2016-09-22
Changed in python-senlinclient:
status: New → In Progress
Qiming Teng (tengqim) on 2016-09-22
no longer affects: senlin
no longer affects: python-senlinclient

I agree with Sean's comments. Is there a known case where MagicMock causes broken tests?

Qiming Teng (tengqim) on 2016-09-22
no longer affects: python-heatclient
shizhihui (shizhihui) on 2016-09-23
Changed in heat-cfntools:
assignee: nobody → shizhihui (shizhihui)
status: New → Incomplete
status: Incomplete → New
no longer affects: heat-cfntools
shizhihui (shizhihui) on 2016-09-23
Changed in heat-cfntools:
assignee: nobody → shizhihui (shizhihui)

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

Changed in heat-cfntools:
status: New → In Progress

Reviewed: https://review.openstack.org/375208
Committed: https://git.openstack.org/cgit/openstack/heat-cfntools/commit/?id=590b3fb99635157a3963f67995593b872f92a1c1
Submitter: Jenkins
Branch: master

commit 590b3fb99635157a3963f67995593b872f92a1c1
Author: shizhihui <email address hidden>
Date: Fri Sep 23 10:57:16 2016 +0800

    Replace 'MagicMock' with 'Mock'

    Change-Id: I24e87a1c341f63929f93d7306782e3e9d6b398fb
    Partial-Bug: #1475722

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

Change abandoned by Sharat Sharma (<email address hidden>) on branch: master
Review: https://review.openstack.org/373725

no longer affects: mistral
no longer affects: python-mistralclient
Changed in ironic:
assignee: nobody → Madhuri Kumari (madhuri-rai07)
Changed in zun:
assignee: nobody → Madhuri Kumari (madhuri-rai07)
Changed in python-higginsclient:
assignee: nobody → Madhuri Kumari (madhuri-rai07)
Changed in zun:
status: New → Confirmed
Changed in magnum:
assignee: nobody → feng.shengqin@zte.com.cn (feng-shengqin)
Changed in python-magnumclient:
assignee: nobody → feng.shengqin@zte.com.cn (feng-shengqin)
no longer affects: rally
no longer affects: python-swiftclient
John L. Villalovos (happycamp) wrote :

Please stop adding projects to this bug. It is not a valid bug.

no longer affects: ironic
summary: - Never use MagicMock
+ Invalid bug, don't try to fix

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

Changed in zun:
status: Confirmed → In Progress
Changed in python-openstacksdk:
status: Fix Committed → Invalid
Changed in zun:
status: In Progress → Invalid
assignee: Madhuri Kumari (madhuri-rai07) → nobody
Changed in python-higginsclient:
assignee: Madhuri Kumari (madhuri-rai07) → nobody

Change abandoned by Madhuri Kumari (<email address hidden>) on branch: master
Review: https://review.openstack.org/414475
Reason: The bug has been marked as invalid, so abandoning it.

no longer affects: zun
Changed in magnum:
assignee: feng.shengqin@zte.com.cn (feng-shengqin) → nobody
Changed in python-magnumclient:
assignee: feng.shengqin@zte.com.cn (feng-shengqin) → nobody

This issue was fixed in the openstack/python-neutronclient 6.1.0 release.

This issue was fixed in the openstack/murano-dashboard 3.1.0 release.

no longer affects: python-higginsclient
no longer affects: magnum
Changed in swift:
assignee: Sharat Sharma (sharat-sharma) → nobody
Tim Burke (1-tim-z) on 2017-09-12
Changed in swift:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers