Skip to content

Commit

Permalink
Refs #36931 - Test that concurrency limit kwargs works
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Nov 20, 2023
1 parent a1cc99a commit e8126d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/actions/bulk_action_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def plan(_target, options = {})
_(task.input[:kw_string]).must_equal 7
_(task.input[:kw_symbol]).must_equal 7
end

specify 'it allows setting concurrency limit' do
Target.expects(:unscoped).returns(Target)
Target.expects(:where).with(:id => targets.map(&:id)).returns(targets)

triggered = ForemanTasks.trigger(ParentAction, ChildAction, targets, concurrency_limit: 25)
task = ForemanTasks::Task.where(:external_id => triggered.id).first
_(task.execution_plan.entry_action.concurrency_limit).must_equal 25
end
end
end
end

0 comments on commit e8126d2

Please sign in to comment.