From ec7bee015c39dec940dd49c4010dfbab4f72a6a8 Mon Sep 17 00:00:00 2001 From: Otto Sabart Date: Tue, 26 Nov 2024 14:50:27 +0100 Subject: [PATCH] Do not save the logs into memory (into an auxiliary variable) Saving the **huge** test outputs into these variables causes the performance bottleneck. --- tmt/steps/report/junit/templates/_base.xml.j2 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tmt/steps/report/junit/templates/_base.xml.j2 b/tmt/steps/report/junit/templates/_base.xml.j2 index a3a1a65829..177112ba57 100644 --- a/tmt/steps/report/junit/templates/_base.xml.j2 +++ b/tmt/steps/report/junit/templates/_base.xml.j2 @@ -5,21 +5,19 @@ {% block testcases %} {% for result in RESULTS %} - {% set main_log = result.log | first | read_log %} - {% set log_failures = main_log | failures | e %} {% set test_duration = result.duration | duration_to_seconds | float %} {% if result.result.value == 'error' or result.result.value == 'warn' %} - {{ log_failures }} + {{ result.log | first | read_log | failures | e }} {% elif result.result.value == 'fail' %} - {{ log_failures }} + {{ result.log | first | read_log | failures | e }} {% elif result.result.value == 'info' %} - {{ log_failures }} + {{ result.log | first | read_log | failures | e }} {% endif %} - {% if INCLUDE_OUTPUT_LOG and main_log %} - {{ main_log | e }} + {% if INCLUDE_OUTPUT_LOG %} + {{ result.log | first | read_log | e }} {% endif %} {# Optionally add the result properties #}