Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22430 - Plugin permissions are cleared on tests #5218

Merged
merged 1 commit into from
Jan 28, 2018

Conversation

dLobatog
Copy link
Member

  • 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*

I realize this is a tough one to test, you have a reproducer here (make sure plugin_test runs before host_js_test) theforeman/foreman_ansible#114 (comment)

@theforeman-bot
Copy link
Member

Issues: #22430

- 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*
@ohadlevy ohadlevy merged commit 52258ef into theforeman:develop Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants