Skip to content

Commit

Permalink
templates: Add macros for build and test summaries
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mrbazzan committed Aug 22, 2022
1 parent bb4f8b2 commit 66fdfba
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions kcidb/templates/misc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66fdfba

Please sign in to comment.