Skip to content

Commit

Permalink
Merge pull request #101 from naotospace/fix-round-report
Browse files Browse the repository at this point in the history
Fix round report
  • Loading branch information
hikimochi authored Jun 12, 2022
2 parents 2417298 + 6eb7c9d commit e9df43a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/bucky/core/test_core/test_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
Expand Down

0 comments on commit e9df43a

Please sign in to comment.