-
Notifications
You must be signed in to change notification settings - Fork 897
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
Return MiqTask id from MiqWidget.queue_generate_content #19445
Return MiqTask id from MiqWidget.queue_generate_content #19445
Conversation
🐐 Does this work when 🐈 Maybe you will need/want to do change in specs to test new return value? 😊 |
@lpichler Tried it with Edit: Added some basic spec. Is that good enough? :) |
spec/models/miq_widget_spec.rb
Outdated
@@ -318,6 +318,10 @@ def add_dashboard_for_user(db_name, userid, group) | |||
} | |||
end | |||
|
|||
it "returns MiqTask id if successful" do | |||
expect(@widget.queue_generate_content).to equal(MiqTask.last.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure whether MiqTask.last
can work always(some other test can recreate new record of MiqTask
?). what about to check if result of this query is present?
MiqTask.where(:name => "Generate Widget: '#{@widget.title}'", :miq_task_id => @widget.reload.miq_task_id )
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpichler Fixed as suggested :)
050eddc
to
c2db6fc
Compare
Checked commits ZitaNemeckova/manageiq@326e314~...c2db6fc with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
@miq-bot assign @gtanzillo |
Needed by ManageIQ/manageiq-ui-classic#6334
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1703068
I need
MiqWidget.queue_generate_content
to return id of createdMiqTask
so I can wait for it to be done before refreshing the UI part.@miq-bot add_label ivanchuk/no, enhancement
@lpichler This is really quick fix that works for me. Any input? Thanks :)