From 985c8ced0b55544f2e8eac9bc726402bbd37b7f7 Mon Sep 17 00:00:00 2001 From: Jedoku Date: Mon, 13 May 2024 04:50:51 +0300 Subject: [PATCH] Add useful info to logs.txt Signed-off-by: Vitalii Chulak --- lib/engines/hcktest/tests.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/engines/hcktest/tests.rb b/lib/engines/hcktest/tests.rb index f8d60538..17d6d8e3 100644 --- a/lib/engines/hcktest/tests.rb +++ b/lib/engines/hcktest/tests.rb @@ -249,10 +249,20 @@ def summary_results_log @tests.reduce('') do |sum, test| extra_info = @tests_extra.dig(test['id'], 'dump') ? '(with Minidump)' : '' status = @tests_extra.dig(test['id'], 'status') || test['status'] - sum + "#{status}: #{test['name']} [#{test['estimatedruntime']}] #{extra_info}\n" + + sum + "#{status}: #{test['name']} [#{test['estimatedruntime']}]#{extra_info}#{format_times(test)}\n" end end + def format_times(test) + queued_at = @tests_extra.dig(test['id'], 'queued_at') + queued_at_str = queued_at ? " [Queued time: #{queued_at}]" : '' + started_at = @tests_extra.dig(test['id'], 'started_at') + started_at_str = started_at ? " [Started time: #{started_at}]" : '' + + "#{queued_at_str}#{started_at_str}" + end + def update_summary_results_log logs = summary_rejected_test_log logs += summary_results_log