-
Notifications
You must be signed in to change notification settings - Fork 92
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 #20692 - Add API for rerunning jobs #288
Conversation
adamruzicka
commented
Oct 19, 2017
•
edited
edited
- tests
Setting |
3e85ac0
to
6079a0f
Compare
👮 is not happy |
37dbbff
to
61e5ecd
Compare
.expects(:validate_job_category) | ||
.with(@invocation.job_category) | ||
.returns(@invocation.job_category) | ||
post :rerun, :id => @invocation.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.
Use keyword arguments instead of positional arguments for http call: post.
.expects(:validate_job_category) | ||
.with(@invocation.job_category) | ||
.returns(@invocation.job_category) | ||
post :rerun, :id => @invocation.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.
Use keyword arguments instead of positional arguments for http call: post.
[test] |
We got conflicts, please rebase and run tests manually, as we have broken master at the moment |
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.
When I was testing with hammer, it succeeded when rerunning all hosts, but failed, when using --failed-only true
:
hammer-cli master → bundle exec bin/hammer job-invocation rerun --id 674
Job invocation was rerun as 677
hammer-cli master → bundle exec bin/hammer job-invocation rerun --id 674 --failed-only true
ERF42-4343 [Foreman::Exception]: Cannot resolve hosts without a user
Backtrace:
|
Adding link to hammer for better orientation theforeman/hammer_cli_foreman_remote_execution#18 |
if @host_ids | ||
{ :search_query => Targeting.build_query_from_hosts(@host_ids), :targeting_type => job_invocation.targeting.targeting_type } | ||
search_query = @host_ids.empty? ? 'name ^ ()' : Targeting.build_query_from_hosts(@host_ids) |
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.
Unnecessary spacing detected.
@@ -194,10 +194,12 @@ def concurrency_control_params | |||
end | |||
|
|||
def targeting_params | |||
base = { :user_id => job_invocation.targeting.user_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.
Maybe it would make sense to use User.current
here instead of copying over the original user
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.
Definitely should be the current user
Running tests manually http://ci.theforeman.org/job/test_plugin_pull_request/4760/ |
Tested and works like a charm. The relevant tests in CI work as well. Thanks @adamruzicka |