Class: KnapsackPro::Allocator
- Inherits:
-
Object
- Object
- KnapsackPro::Allocator
- Defined in:
- lib/knapsack_pro/allocator.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Allocator
constructor
A new instance of Allocator.
- #test_file_paths ⇒ Object
Constructor Details
#initialize(args) ⇒ Allocator
Returns a new instance of Allocator.
3 4 5 6 7 8 |
# File 'lib/knapsack_pro/allocator.rb', line 3 def initialize(args) @test_files = args.fetch(: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 |
Instance Method Details
#test_file_paths ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/knapsack_pro/allocator.rb', line 10 def test_file_paths connection = KnapsackPro::Client::Connection.new(build_action) response = connection.call if connection.success? raise ArgumentError.new(response) if connection.errors? prepare_test_files(response) else KnapsackPro.logger.warn("Fallback mode started. We could not connect with Knapsack Pro API. Your tests will be executed based on directory names. Read more about fallback mode at https://github.com/KnapsackPro/knapsack_pro-ruby#what-happens-when-knapsack-pro-api-is-not-availablenot-reachable-temporarily") fallback_test_files end end |