Dashboard tests register admin.aggregates as side effect

Bug #1384683 reported by Radomir Dopieralski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Radomir Dopieralski

Bug Description

The mocks that have recently been added to the setUp method of the Openstack Dashboard TestCase have a side effect of registering the admin.aggregates panel, even if it has been disabled in the configuration. That's because Mock has to import the module in order to mock anything inside it, and importing the panel module has a side effect of registering the panel (the register command is at the top level of the module code).

This doesn't affect the Dashboard tests, as this panel is already registered in them. However, in Tuskar-UI we disable all dashboards and their panels except for the infrastructure dashboard that we are adding. This leads to url resolution errors when a panel is being registered in a dashboard that doesn't exist.

Revision history for this message
Radomir Dopieralski (deshipu) wrote :

I'm setting this to critical, because it breaks the tuskar-ui gate.

Changed in horizon:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Radomir Dopieralski (thesheep)
Revision history for this message
Radomir Dopieralski (deshipu) wrote :

The solution we came up with is to move the mocks into a separate method on the TestCase, and override that method in Tuskar-UI's TestCase. We are open to suggestions for a better solution.

Revision history for this message
Radomir Dopieralski (deshipu) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/130503
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=dece4cc34573a6ccf3382cebddb8c819c34bdb75
Submitter: Jenkins
Branch: master

commit dece4cc34573a6ccf3382cebddb8c819c34bdb75
Author: Radomir Dopieralski <email address hidden>
Date: Thu Oct 23 13:23:41 2014 +0200

    Move the panel mocks to a separate method on TestCase

    We need to remove the panel mocks in Tuskar-UI tests, because they
    import and register the admin panel as their side effect. To do that
    easily, I'm moving that part into a separate method.

    Partial-bug: #1384683
    Change-Id: Ica366c0b9f680049a74e94007a563ffdb492e4f4

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Akihiro Motoki (amotoki) wrote :

It was fixed in Kilo cycle, so I targeted it to KIlo-RC1 so that we can release it as part of Kilo release.

Changed in horizon:
milestone: none → kilo-rc1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-rc1 → 2015.1.0
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.