Skip to content

Commit

Permalink
return a test case path and other file
Browse files Browse the repository at this point in the history
related to: #139
  • Loading branch information
ArturT committed Dec 28, 2023
1 parent 42c95ae commit 007564d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/knapsack_pro/queue_allocator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ def initialize(args)
end

def test_file_paths(can_initialize_queue, executed_test_files)
@@index ||= 0
batches = [
['spec/features/calculator_spec.rb[1:2:1]', 'spec/controllers/articles_controller_spec.rb'],
['spec/collection_spec.rb'],
]
tests = batches[@@index] || []
@@index += 1
return tests

return [] if @fallback_activated
action = build_action(can_initialize_queue, attempt_connect_to_queue: can_initialize_queue)
connection = KnapsackPro::Client::Connection.new(action)
Expand Down
2 changes: 2 additions & 0 deletions lib/knapsack_pro/runners/queue/rspec_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def self.run_tests(accumulator)
can_initialize_queue: can_initialize_queue,
executed_test_files: all_test_file_paths
)
puts 'INSPECT'
puts test_file_paths.inspect

if test_file_paths.empty?
unless all_test_file_paths.empty?
Expand Down

0 comments on commit 007564d

Please sign in to comment.