[openstack-dev] [Horizon] Question regarding new panels and tests
Tzu-Mainn Chen
tzumainn at redhat.com
Wed Apr 23 20:23:29 UTC 2014
> 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
More information about the OpenStack-dev
mailing list