Class: Knapsack::Distributors::ReportDistributor
Instance Attribute Summary
#node_tests, #report, #test_file_pattern
Instance Method Summary
collapse
#all_tests, #assign_test_files_to_node, #ci_node_index, #ci_node_total, #initialize, #tests_for_current_node, #tests_for_node
Instance Method Details
#node_time_execution ⇒ Object
16
17
18
|
# File 'lib/knapsack/distributors/report_distributor.rb', line 16
def node_time_execution
@node_time_execution ||= total_time_execution / ci_node_total
end
|
#sorted_report ⇒ Object
4
5
6
|
# File 'lib/knapsack/distributors/report_distributor.rb', line 4
def sorted_report
@sorted_report ||= report.sort_by { |_test_path, time| -time }
end
|
#sorted_report_with_existing_tests ⇒ Object
8
9
10
|
# File 'lib/knapsack/distributors/report_distributor.rb', line 8
def sorted_report_with_existing_tests
@sorted_report_with_existing_tests ||= sorted_report.select { |test_path, time| all_tests.include?(test_path) }
end
|
#total_time_execution ⇒ Object
12
13
14
|
# File 'lib/knapsack/distributors/report_distributor.rb', line 12
def total_time_execution
@total_time_execution ||= sorted_report_with_existing_tests.map { |_test_path, time| time }.reduce(0, :+).to_f
end
|