From f603b77e1fb538e46002a4259efdaed32f3ed14e Mon Sep 17 00:00:00 2001 From: Abdulwasiu Apalowo Date: Mon, 22 Aug 2022 21:35:30 +0100 Subject: [PATCH] templates: Add macros for build and test summaries This introduces the seperate macros to generate the build and test overview respectively. With the help of the custom filters defined, a generic list is gotten from the list of tests and builds; this generic list is then passed to a macro which returns the appropriate format strings. The formatted strings are then used in-turn to display items properly aligned in their column. Signed-off-by: Abdulwasiu Apalowo --- kcidb/templates/misc.j2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kcidb/templates/misc.j2 b/kcidb/templates/misc.j2 index 3e3d9971..347ec05e 100644 --- a/kcidb/templates/misc.j2 +++ b/kcidb/templates/misc.j2 @@ -40,6 +40,27 @@ {{ builds }} {% endmacro %} +{% macro overview_list(container) %} + {% set tests = all_tests(container.tests_root.waived_status_nodes) | convert_to_list %} + {% set builds = all_builds(container.builds) | convert_to_list %} + + {{ (tests, builds) | max_container }} +{% endmacro %} + +{% macro build_overview(container) %} + {% set builds = all_builds(container.builds) | convert_to_list %} + {%- set _format = overview_list(container) | convert_to_list | generic_format(type="build", bpoint=builds | length) %} + + {{- _format | format(*builds) -}} +{% endmacro %} + +{% macro test_overview(container) %} + {% set tests = all_tests(container.tests_root.waived_status_nodes) | convert_to_list %} + {%- set _format = overview_list(container) | convert_to_list | generic_format(bpoint=tests | length) %} + + {{- _format | format(*tests) -}} +{% endmacro %} + {% macro legend() %} LEGEND