From 6eb7c9dc8817c91223e7e392910e1e70e311e818 Mon Sep 17 00:00:00 2001 From: naotospace Date: Fri, 10 Jun 2022 09:34:10 +0900 Subject: [PATCH] Collect round result --- lib/bucky/core/test_core/test_manager.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/bucky/core/test_core/test_manager.rb b/lib/bucky/core/test_core/test_manager.rb index adaa634..069b101 100644 --- a/lib/bucky/core/test_core/test_manager.rb +++ b/lib/bucky/core/test_core/test_manager.rb @@ -152,13 +152,13 @@ def do_test_suites(test_suite_data) end def execute_test - results_set = {} + all_round_results = [] @re_test_count.times do |i| Bucky::Core::TestCore::ExitHandler.instance.reset $round = i + 1 @json_report[:summary][:round_count] = $round test_suite_data = load_test_suites - results_set = do_test_suites(test_suite_data) + all_round_results.append(do_test_suites(test_suite_data)) @test_cond[:re_test_cond] = @tdo.get_ng_test_cases_at_last_execution( is_error: 1, job_id: $job_id, round: $round ) @@ -167,11 +167,9 @@ def execute_test return unless @test_cond[:out] - results_set.each do |_class_name, res| - @json_report[:summary][:cases_count] += res['cases_count'] - @json_report[:summary][:success_count] += res['success_count'] - @json_report[:summary][:failure_count] += res['failure_count'] - end + @json_report[:summary][:cases_count] = all_round_results[0].sum { |_case, res| res[:case_count] } + @json_report[:summary][:failure_count] = all_round_results[-1].sum { |_case, res| res[:failure_count] } + @json_report[:summary][:success_count] = @json_report[:summary][:cases_count] - @json_report[:summary][:failure_count] File.open(@test_cond[:out], 'w') do |f| f.puts(@json_report.to_json)