Actions
Bug #22430
closedPlugin permissions are cleared on tests
Description
The problem:
- Some tests are removing all plugins (plugin_test, rabl_test, belongs_to_proxy_test) from the registry. This has, among others, one important consequence: the plugin permissions are removed.
- Take an example. Foreman Ansible overrides the Host#form with a list of 'Ansible Roles' to choose.
- When the view for this Host#form is rendered (e.g: a HostController or HostJSTest), the list of 'Ansible Roles' has also to be rendered.
- Since a previous test removed the plugin from the `Foreman::Plugin.all` registry, but the plugin is still installed as a Rails Engine, the overrides by deface still apply.
- Some tests that render the Host form fail to run as rendering is impossible without the 'ansible_roles' permission. These permissions are only loaded in tests if the plugin is registered in Foreman::Plugin*
Foreman::Plugin::RbacRegistry should not be cleared https://github.com/theforeman/foreman/blob/develop/test/fixtures/permissions.yml#L772
To fix this, I suggest adding a helper method to our test_helper to handle removing & restoring.
Updated by The Foreman Bot almost 7 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Pull request https://github.com/theforeman/foreman/pull/5218 added
Updated by Ohad Levy almost 7 years ago
- Translation missing: en.field_release set to 330
Updated by Anonymous almost 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 52258efc30a69983c9ec1c55b898165bd21db8de.
Actions