Remove Use of mox/mox3 for Testing

Bug #1758388 reported by Alexander Chadin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
Fix Released
High
licanwei

Bug Description

Mocking in unit tests in OpenStack started off using the mox package. Unfortunately, this package is no longer actively maintained and had its last update published to PyPi in August of 2010.

Due to this long period of inactivity, mox was never updated to add support for Python 3. To get around this, the oslo team has been maintaining a mox3 fork to support migration of consuming projects to Python 3. This was done as a short term solution to allow projects to migrate to the more supported mock package.

Most projects have adopted mock, but many still have some use of mox/mox3 in their tests. To get rid of mox, retire mox3, and provide a clean path to full Python 3 support, we need to finish moving all projects off of mox and update tests to use mock.

Link to the goal: https://governance.openstack.org/tc/goals/rocky/mox_removal.html

I have found that watcher-dashboard uses mox for testing. We need to remove
this usage.

Changed in watcher:
status: New → Triaged
importance: Undecided → Critical
importance: Critical → High
Changed in watcher:
assignee: nobody → licanwei (li-canwei2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to watcher-dashboard (master)

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

Changed in watcher:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to watcher-dashboard (master)

Reviewed: https://review.openstack.org/559536
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=26779532f2c467da505db8a8f321bf444e7f4d2c
Submitter: Zuul
Branch: master

commit 26779532f2c467da505db8a8f321bf444e7f4d2c
Author: licanwei <email address hidden>
Date: Sat Apr 7 23:55:25 2018 -0700

    Remove mox usage from audittemplate tests

    This is part of mox-removal community goal in Rocky.

    Change-Id: Ia629ca26b1057fd0619869007eeadf7640cbeb17
    Partial-Bug: #1758388

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/559531
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=2c80e96faf8ae19d0531c772903515528f1ff62c
Submitter: Zuul
Branch: master

commit 2c80e96faf8ae19d0531c772903515528f1ff62c
Author: licanwei <email address hidden>
Date: Sat Apr 7 23:05:02 2018 -0700

    Remove mox usage from goal tests

    This is part of mox-removal community goal in Rocky.

    Change-Id: I5b90fc3071bbd7f54ffe807812da1b828b96693a
    Partial-Bug: #1758388

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/559557
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=9db2c43895c373f90ce8b9b0c4ef179bff5be2f4
Submitter: Zuul
Branch: master

commit 9db2c43895c373f90ce8b9b0c4ef179bff5be2f4
Author: licanwei <email address hidden>
Date: Sun Apr 8 01:54:09 2018 -0700

    Remove mox usage from api tests

    This is part of mox-removal community goal in Rocky.

    Change-Id: I2805cddf4419fe5732fb832fdf2dba5f7c370422
    Partial-Bug: #1758388

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/559534
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=96887209f8f4f6f83da4362bd2bde52c8a45030d
Submitter: Zuul
Branch: master

commit 96887209f8f4f6f83da4362bd2bde52c8a45030d
Author: licanwei <email address hidden>
Date: Sat Apr 7 23:31:18 2018 -0700

    Remove mox usage from strategy tests

    This is part of mox-removal community goal in Rocky.

    Change-Id: Ib4e4adfa0d907c05eb5407c36a58a791d0b679e4
    Partial-Bug: #1758388

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to watcher-dashboard (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to watcher-dashboard (master)

Reviewed: https://review.openstack.org/562444
Committed: https://git.openstack.org/cgit/openstack/watcher-dashboard/commit/?id=810bd7e5897716f433a1a8b2b8f4e4dc89673043
Submitter: Zuul
Branch: master

commit 810bd7e5897716f433a1a8b2b8f4e4dc89673043
Author: licanwei <email address hidden>
Date: Wed Apr 18 19:13:41 2018 -0700

    Drop mox3 from test-requirements.txt

    create_stubs in test.helpers is also dropped in
    this commit because this creates a stub using mox.
    This is part of mox-removal community goal in Rocky.

    Change-Id: I54b3679bf294f20910fae9bf9ee442769455415b
    Closes-Bug: #1758388

Changed in watcher:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/watcher-dashboard 1.10.0

This issue was fixed in the openstack/watcher-dashboard 1.10.0 release.

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.