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

GenericObject spec - fix failures after core PR #563

Merged
merged 1 commit into from
Mar 8, 2019
Merged

GenericObject spec - fix failures after core PR #563

merged 1 commit into from
Mar 8, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Mar 8, 2019

add_members doesn't set button_order,
but setting button_order now implicitly adds members

broken by ManageIQ/manageiq#18368

this should fix this error on travis:

Failures:
  1) GenericObjects API GET /api/generic_objects/:id includes the hrefs for custom buttons and button groups
     Failure/Error: expect(response.parsed_body).to include(expected)
       expected {"href" => "http://www.example.com/api/generic_objects/87000000000011", "id" => "87000000000011", "name"=...ric_group", "method" => "post", "href" => "http://www.example.com/api/generic_objects/87000000000011"}]} to include {"custom_actions" => (a hash including {"buttons" => (a collection containing exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000021"}) and (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000019"})), "button_groups" => (a collection containing exactly (a hash including {"href" => "http://www.example.com/api/custom_button_sets/87000000000005", "buttons...exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000020"}))}) and (a hash including {"href" => "http://www.example.com/api/custom_button_sets/87000000000006", "buttons...exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000022"}))}))})}
       Diff:
       @@ -1,2 +1,10 @@
       -"custom_actions" => (a hash including {"buttons" => (a collection containing exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000021"}) and (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000019"})), "button_groups" => (a collection containing exactly (a hash including {"href" => "http://www.example.com/api/custom_button_sets/87000000000005", "buttons...exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000020"}))}) and (a hash including {"href" => "http://www.example.com/api/custom_button_sets/87000000000006", "buttons...exactly (a hash including {"href" => "http://www.example.com/api/custom_buttons/87000000000022"}))}))}),
       +"actions" => [{"name"=>"method_a", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}, {"name"=>"method_b", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}, {"name"=>"generic_no_group", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}, {"name"=>"assigned_no_group", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}, {"name"=>"assigned_group", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}, {"name"=>"generic_group", "method"=>"post", "href"=>"http://www.example.com/api/generic_objects/87000000000011"}],
       +"created_at" => "2019-03-08T01:44:43Z",
       +"custom_actions" => {"buttons"=>[{"id"=>"87000000000019", "guid"=>"60782fe7-34c2-4afe-b843-214767cc0def", "description"=>"custom_button_0000000000018", "applies_to_class"=>"GenericObject", "visibility_expression"=>nil, "options"=>{}, "userid"=>nil, "wait_for_complete"=>nil, "created_on"=>"2019-03-08T01:44:43Z", "updated_on"=>"2019-03-08T01:44:43Z", "name"=>"generic_no_group", "visibility"=>nil, "applies_to_id"=>nil, "enablement_expression"=>nil, "disabled_text"=>nil, "enabled"=>true, "href"=>"http://www.example.com/api/custom_buttons/87000000000019"}, {"id"=>"87000000000021", "guid"=>"a995cd72-d13e-4a85-980e-c74389c13be3", "description"=>"custom_button_0000000000020", "applies_to_class"=>"GenericObjectDefinition", "visibility_expression"=>nil, "options"=>{}, "userid"=>nil, "wait_for_complete"=>nil, "created_on"=>"2019-03-08T01:44:43Z", "updated_on"=>"2019-03-08T01:44:43Z", "name"=>"assigned_no_group", "visibility"=>nil, "applies_to_id"=>"87000000000026", "enablement_expression"=>nil, "disabled_text"=>nil, "enabled"=>true, "href"=>"http://www.example.com/api/custom_buttons/87000000000021"}, {"id"=>"87000000000022", "guid"=>"6587977a-0793-4974-9c21-cf32703f851e", "description"=>"custom_button_0000000000021", "applies_to_class"=>"GenericObjectDefinition", "visibility_expression"=>nil, "options"=>{}, "userid"=>nil, "wait_for_complete"=>nil, "created_on"=>"2019-03-08T01:44:43Z", "updated_on"=>"2019-03-08T01:44:43Z", "name"=>"assigned_group", "visibility"=>nil, "applies_to_id"=>"87000000000026", "enablement_expression"=>nil, "disabled_text"=>nil, "enabled"=>true, "href"=>"http://www.example.com/api/custom_buttons/87000000000022"}], "button_groups"=>[{"id"=>"87000000000005", "name"=>"generic_group_set", "description"=>"custom_button_set_0000000000005", "created_on"=>"2019-03-08T01:44:43Z", "updated_on"=>"2019-03-08T01:44:43Z", "guid"=>"05235aaa-020a-4f9b-b68e-542cfd5890eb", "read_only"=>nil, "set_data"=>nil, "mode"=>nil, "owner_type"=>nil, "owner_id"=>nil, "userid"=>nil, "group_id"=>nil, "buttons"=>[{"id"=>"87000000000020", "guid"=>"c0a9b5c1-cd75-4cdb-8c76-2fdcfc2e820b", "description"=>"custom_button_0000000000019", "applies_to_class"=>"GenericObject", "visibility_expression"=>nil, "options"=>{}, "userid"=>nil, "wait_for_complete"=>nil, "created_on"=>"2019-03-08T01:44:43Z", "updated_on"=>"2019-03-08T01:44:43Z", "name"=>"generic_group", "visibility"=>nil, "applies_to_id"=>nil, "enablement_expression"=>nil, "disabled_text"=>nil, "enabled"=>true, "href"=>"http://www.example.com/api/custom_buttons/87000000000020"}], "href"=>"http://www.example.com/api/custom_button_sets/87000000000005"}]},
       +"generic_object_definition_id" => "87000000000026",
       +"href" => "http://www.example.com/api/generic_objects/87000000000011",
       +"id" => "87000000000011",
       +"name" => "object 1",
       +"uid" => nil,
       +"updated_at" => "2019-03-08T01:44:43Z",
     # ./spec/requests/generic_objects_spec.rb:155:in `block (3 levels) in <top (required)>'

add_members doesn't set button_order,
but setting button_order now implicitly adds members

broken by ManageIQ/manageiq#18368
@miq-bot
Copy link
Member

miq-bot commented Mar 8, 2019

Checked commit https://github.com/himdel/manageiq-api/commit/b8572ec5c0f45660cdd7841c47cd5a253c37a0d7 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. 🍰

@djberg96
Copy link
Contributor

djberg96 commented Mar 8, 2019

👍

@gtanzillo gtanzillo added this to the Sprint 107 Ending Mar 18, 2019 milestone Mar 8, 2019
@gtanzillo gtanzillo merged commit 5f19041 into ManageIQ:master Mar 8, 2019
@himdel himdel deleted the custom-button-set branch March 11, 2019 10:23
@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
GenericObject spec - fix failures after core PR

(cherry picked from commit 5f19041)

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 890c3afbf5e25c68bbf759e4006187c0961a0109
Author: Gregg Tanzillo <[email protected]>
Date:   Fri Mar 8 08:23:29 2019 -0500

    Merge pull request #563 from himdel/custom-button-set
    
    GenericObject spec - fix failures after core PR
    
    (cherry picked from commit 5f1904138cd0468ec7e85ca4a8077c4062b00631)
    
    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.

7 participants