Skip to content

Commit f603b77

Browse files
committed
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 <[email protected]>
1 parent 9d6119a commit f603b77

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

kcidb/templates/misc.j2

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@
4040
{{ builds }}
4141
{% endmacro %}
4242

43+
{% macro overview_list(container) %}
44+
{% set tests = all_tests(container.tests_root.waived_status_nodes) | convert_to_list %}
45+
{% set builds = all_builds(container.builds) | convert_to_list %}
46+
47+
{{ (tests, builds) | max_container }}
48+
{% endmacro %}
49+
50+
{% macro build_overview(container) %}
51+
{% set builds = all_builds(container.builds) | convert_to_list %}
52+
{%- set _format = overview_list(container) | convert_to_list | generic_format(type="build", bpoint=builds | length) %}
53+
54+
{{- _format | format(*builds) -}}
55+
{% endmacro %}
56+
57+
{% macro test_overview(container) %}
58+
{% set tests = all_tests(container.tests_root.waived_status_nodes) | convert_to_list %}
59+
{%- set _format = overview_list(container) | convert_to_list | generic_format(bpoint=tests | length) %}
60+
61+
{{- _format | format(*tests) -}}
62+
{% endmacro %}
63+
4364
{% macro legend() %}
4465

4566
LEGEND

0 commit comments

Comments
 (0)