lib/knapsack_pro/client/api/v1/queues.rb in knapsack_pro-1.8.0 vs lib/knapsack_pro/client/api/v1/queues.rb in knapsack_pro-1.9.0

- old
+ new

@@ -3,22 +3,29 @@ module API module V1 class Queues < Base class << self def queue(args) + request_hash = { + :fixed_queue_split => KnapsackPro::Config::Env.fixed_queue_split, + :can_initialize_queue => args.fetch(:can_initialize_queue), + :commit_hash => args.fetch(:commit_hash), + :branch => args.fetch(:branch), + :node_total => args.fetch(:node_total), + :node_index => args.fetch(:node_index), + :node_build_id => KnapsackPro::Config::Env.ci_node_build_id, + } + + if request_hash[:can_initialize_queue] + request_hash.merge!({ + :test_files => args.fetch(:test_files) + }) + end + action_class.new( endpoint_path: '/v1/queues/queue', http_method: :post, - request_hash: { - :fixed_queue_split => KnapsackPro::Config::Env.fixed_queue_split, - :can_initialize_queue => args.fetch(:can_initialize_queue), - :commit_hash => args.fetch(:commit_hash), - :branch => args.fetch(:branch), - :node_total => args.fetch(:node_total), - :node_index => args.fetch(:node_index), - :node_build_id => KnapsackPro::Config::Env.ci_node_build_id, - :test_files => args.fetch(:test_files) - } + request_hash: request_hash ) end end end end