Refactor tests in tripleoclient

Bug #1619350 reported by Dougal Matthews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Kamil Sambor

Bug Description

At the moment tripleoclient uses tons (and tons and tons) of mocks. These were originally used as the quickest way to get started but have become unmaintainable.

At the current count, there are 158 mock.patch calls in test_overcloud_deploy.

New tests when added typically copy others and thus add many more mocks. It would be much better to have fakes for the services that we currently mock. This would mean that they are updated in a central place and would remove some of the duplication and over mocking.

Dougal Matthews (d0ugal)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

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

Changed in tripleo:
assignee: nobody → Steven Hardy (shardy)
status: Confirmed → In Progress
Revision history for this message
Emilien Macchi (emilienm) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in tripleo:
status: In Progress → Confirmed
assignee: Steven Hardy (shardy) → nobody
Revision history for this message
Ryan Brady (rbrady) wrote :

fix linked to a different bug in the commit msg. This appears fixed. This bug doesn't look relevant any more. If you feel it is still relevant, please re-open the bug.

Changed in tripleo:
status: Confirmed → Fix Released
Revision history for this message
Julie Pichon (jpichon) wrote :

Reopening as this is still valid IMO (agree that the open review isn't related, I think it was a typo). The mock count in test_overcloud_deploy is at 197 now.

Changed in tripleo:
status: Fix Released → Triaged
Dougal Matthews (d0ugal)
Changed in tripleo:
milestone: none → queens-1
Changed in tripleo:
milestone: queens-1 → queens-2
Changed in tripleo:
milestone: queens-2 → queens-3
Changed in tripleo:
milestone: queens-3 → queens-rc1
Changed in tripleo:
milestone: queens-rc1 → rocky-1
Changed in tripleo:
milestone: rocky-1 → rocky-2
Changed in tripleo:
milestone: rocky-2 → rocky-3
Kamil Sambor (ksambor)
Changed in tripleo:
assignee: nobody → Kamil Sambor (ksambor)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

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

Changed in tripleo:
milestone: rocky-3 → stein-1
tags: added: tech-debt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/578751
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=7df59bcab44d030dc557cc5a10d4d7eda5c49c99
Submitter: Zuul
Branch: master

commit 7df59bcab44d030dc557cc5a10d4d7eda5c49c99
Author: Kamil Sambor <email address hidden>
Date: Thu Jun 28 10:47:45 2018 +0200

    Reduce number of mock in tests

    Move mocks into setUp part of the code

    Change-Id: I5fd6f57d8107e3c84933d0c7bf356c46011de019
    Partial-Bug: 1619350

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

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

Changed in tripleo:
assignee: Kamil Sambor (ksambor) → Dougal Matthews (d0ugal)
Kamil Sambor (ksambor)
Changed in tripleo:
assignee: Dougal Matthews (d0ugal) → Kamil Sambor (ksambor)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/579538
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=11d298140409ad8db256f93c2af112904ba361e3
Submitter: Zuul
Branch: master

commit 11d298140409ad8db256f93c2af112904ba361e3
Author: Kamil Sambor <email address hidden>
Date: Mon Jul 2 14:16:43 2018 +0200

    Add fixtures instead mock

    Add fixtures to replace mocks of deployment workflow
    inside overcloud deployment tests

    Partial-Bug: 1619350
    Change-Id: I620fa04af281a02600da4b6d059e9830a9dcdd7c

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

Reviewed: https://review.openstack.org/581342
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=a4e1ef37560bc3155f653d432d6d403a58bdc21a
Submitter: Zuul
Branch: master

commit a4e1ef37560bc3155f653d432d6d403a58bdc21a
Author: Kamil Sambor <email address hidden>
Date: Tue Jul 10 11:45:34 2018 +0200

    Add fixtures instead mocks

    Replace mocks of deployment functions and utils
    with fixtures

    Change-Id: I49ea58465509935b774ada5bd3b4e19acb621e23
    Partial-Bug: 1619350

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

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

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

Reviewed: https://review.openstack.org/600415
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=16b5048f0213c0314a32d1d74b75c21c310265d7
Submitter: Zuul
Branch: master

commit 16b5048f0213c0314a32d1d74b75c21c310265d7
Author: Kamil Sambor <email address hidden>
Date: Thu Sep 6 12:17:18 2018 +0200

    Add fixture to replace multiple mocks

    Add fixture for overcloud operations

    Change-Id: I41a060a5c4035edfd94de80b9a1cc2f734941fee
    Closes-Bug: 1619350

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 11.1.0

This issue was fixed in the openstack/python-tripleoclient 11.1.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.