lib/knapsack_pro/allocator.rb in knapsack_pro-1.20.2 vs lib/knapsack_pro/allocator.rb in knapsack_pro-1.21.0
- old
+ new
@@ -1,9 +1,10 @@
module KnapsackPro
class Allocator
def initialize(args)
- @test_files = args.fetch(:test_files)
+ @fast_and_slow_test_files_to_run = args.fetch(:fast_and_slow_test_files_to_run)
+ @fallback_mode_test_files = args.fetch(:fallback_mode_test_files)
@ci_node_total = args.fetch(:ci_node_total)
@ci_node_index = args.fetch(:ci_node_index)
@repository_adapter = args.fetch(:repository_adapter)
end
@@ -30,17 +31,18 @@
end
end
private
- attr_reader :test_files,
+ attr_reader :fast_and_slow_test_files_to_run,
+ :fallback_mode_test_files,
:ci_node_total,
:ci_node_index,
:repository_adapter
def encrypted_test_files
- KnapsackPro::Crypto::Encryptor.call(test_files)
+ KnapsackPro::Crypto::Encryptor.call(fast_and_slow_test_files_to_run)
end
def encrypted_branch
KnapsackPro::Crypto::BranchEncryptor.call(repository_adapter.branch)
end
@@ -54,15 +56,15 @@
test_files: encrypted_test_files,
)
end
def prepare_test_files(response)
- decrypted_test_files = KnapsackPro::Crypto::Decryptor.call(test_files, response['test_files'])
+ decrypted_test_files = KnapsackPro::Crypto::Decryptor.call(fast_and_slow_test_files_to_run, response['test_files'])
KnapsackPro::TestFilePresenter.paths(decrypted_test_files)
end
def fallback_test_files
- test_flat_distributor = KnapsackPro::TestFlatDistributor.new(test_files, ci_node_total)
+ test_flat_distributor = KnapsackPro::TestFlatDistributor.new(fallback_mode_test_files, ci_node_total)
test_files_for_node_index = test_flat_distributor.test_files_for_node(ci_node_index)
KnapsackPro::TestFilePresenter.paths(test_files_for_node_index)
end
end
end