[openstack-dev] [Horizon] Question regarding new panels and tests

Chad Roberts croberts at redhat.com
Wed Apr 23 21:11:00 UTC 2014


Thanks Mainn, that approach does work to get my panels registered for the tests and takes care of all of the errors that I saw.

Bad news is that it gives me a couple of new ones.  They are pasted here:  http://ur1.ca/h5l8u
It looks like the panel_group_tests and panel tests want to do a deepcopy on HORIZON_CONFIG, which usually works now fails.

In test/settings.py, I can do the deepcopy before I call settings.update_dashboards, but it will fail after the call to update_dashboards.  Something non-deep-copy-able must be getting stuck in there, but I can't see it.  Any thoughts?

Thanks again,
Chad

----- Original Message -----
From: "Tzu-Mainn Chen" <tzumainn at redhat.com>
To: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev at lists.openstack.org>
Sent: Wednesday, April 23, 2014 4:23:29 PM
Subject: Re: [openstack-dev] [Horizon] Question regarding new panels and tests

> I have a question about adding new panels with respect to tests.
> 
> I have a new panel (for the Sahara project, data processing) that lives (for
> now at least) under the projects folder.  The plan is to have it activated
> only by using the new "enabled" mechanism to define a new panel group, "data
> processing", where it and several other panels will eventually show up.
> 
> When I did this, it works fine for me when I run it, but running the tests
> (tox -e py27) fails because my panel is not registered anywhere.  Is there a
> config for the tests that I can tweak so that my panel can be registered for
> the tests (tests/enabled or something like that?
> 
> Thanks,
> Chad
> 

Hiya - I haven't tested this, but one thing you could try. . . if you look at 
horizon/openstack_dashboard/settings.py, there's a section that determines
where the dashboard looks for plugins (https://github.com/openstack/horizon/blob/master/openstack_dashboard/settings.py#L220)

   # Load the pluggable dashboard settings
   import openstack_dashboard.enabled
   import openstack_dashboard.local.enabled
   from openstack_dashboard.utils import settings

   INSTALLED_APPS = list(INSTALLED_APPS) # Make sure it's mutable
   settings.update_dashboards([
       openstack_dashboard.enabled,
       openstack_dashboard.local.enabled,
   ], HORIZON_CONFIG, INSTALLED_APPS)

If you edit horizon/openstack_dashboard/settings.py to add a similar section,
only using, say, openstack_dashboard.test.local.enabled, you may be able to enable
the panels for the tests there.

Mainn



_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list