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

Fix failing travis - stub my_server when dealing with custom button sets #5319

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Mar 8, 2019

Likely related to ManageIQ/manageiq#18368

Using Rbac.filtered needs user's timezone, and for that, settings have to be stubbed, or MiqServer.my_server set.

Since creating a custom button set now needs Rbac.filtered, adding...

Should prevent:

Failures:
  1) ApplicationHelper::ToolbarBuilder custom_buttons for VM behaves like with custom buttons #get_custom_buttons
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:144
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  2) ApplicationHelper::ToolbarBuilder custom_buttons for VM behaves like with custom buttons #custom_button_selects
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:144
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  3) ApplicationHelper::ToolbarBuilder custom_buttons for VM behaves like with custom buttons #build_custom_toolbar_class
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:144
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  4) ApplicationHelper::ToolbarBuilder custom_buttons for VM behaves like with custom buttons #record_to_service_buttons
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:144
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  5) ApplicationHelper::ToolbarBuilder custom_buttons for Service behaves like with custom buttons #get_custom_buttons
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:153
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  6) ApplicationHelper::ToolbarBuilder custom_buttons for Service behaves like with custom buttons #record_to_service_buttons
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:153
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  7) ApplicationHelper::ToolbarBuilder custom_buttons for Service behaves like with custom buttons #custom_button_selects
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:153
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'
  8) ApplicationHelper::ToolbarBuilder custom_buttons for Service behaves like with custom buttons #build_custom_toolbar_class
     Failure/Error: MiqServer.my_server.server_timezone
     NoMethodError:
       undefined method `server_timezone' for nil:NilClass
     Shared Example Group: "with custom buttons" called from ./spec/helpers/application_helper/toolbar_builder_spec.rb:153
     # ./spec/manageiq/app/models/mixins/timezone_mixin.rb:21:in `server_timezone'
     # ./spec/manageiq/app/models/user.rb:204:in `get_timezone'
     # ./spec/manageiq/lib/rbac/filterer.rb:206:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:132:in `search'
     # ./spec/manageiq/lib/rbac.rb:3:in `search'
     # ./spec/manageiq/lib/rbac/filterer.rb:355:in `filtered'
     # ./spec/manageiq/lib/rbac/filterer.rb:136:in `filtered'
     # ./spec/manageiq/lib/rbac.rb:11:in `filtered'
     # ./spec/manageiq/app/models/custom_button_set.rb:10:in `validate_children'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:38:in `add_button_to_set'
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:45:in `block (4 levels) in <top (required)>'

@himdel himdel added the test label Mar 8, 2019
@miq-bot
Copy link
Member

miq-bot commented Mar 8, 2019

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/8f47991cf98b3cfddff90c2987097f7678ee7f23 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@martinpovolny martinpovolny merged commit d74ba60 into ManageIQ:master Mar 8, 2019
@martinpovolny martinpovolny self-assigned this Mar 8, 2019
@martinpovolny martinpovolny added this to the Sprint 107 Ending Mar 18, 2019 milestone Mar 8, 2019
@himdel himdel deleted the zlo branch March 8, 2019 12:38
@d-m-u
Copy link
Contributor

d-m-u commented Aug 21, 2019

@miq-bot add_label hammer/yes

simaishi pushed a commit that referenced this pull request Sep 5, 2019
Fix failing travis - stub my_server when dealing with custom button sets

(cherry picked from commit d74ba60)

https://bugzilla.redhat.com/show_bug.cgi?id=1745198
@simaishi
Copy link
Contributor

simaishi commented Sep 5, 2019

Hammer backport details:

$ git log -1
commit 3db2f34af55f1680353f4caf6d033c9db418f480
Author: Martin Povolny <[email protected]>
Date:   Fri Mar 8 12:13:05 2019 +0100

    Merge pull request #5319 from himdel/zlo
    
    Fix failing travis - stub my_server when dealing with custom button sets
    
    (cherry picked from commit d74ba6089332b1682490bf4a88b3a68b6939db6e)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1745198

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.

5 participants