{% macro pipeline(directory, name) %}

{{ name }}

{% set latest = [] %} {% set data = [] %} {% for impl in config.extra.tests.pipelines[name].impl %} {# Don't forget to trim() to remove confusing trailing newline #} {% set_global latest = latest | concat(with=load_data(path="static/"~config.extra.tests.directory~"/"~impl.name~"/latest")|trim()) %} {% set_global data = data | concat(with=load_data(path="static/"~config.extra.tests.directory~"/"~impl.name~"/results.toml")) %} {% endfor %} {% for impl in config.extra.tests.pipelines[name].impl %} {% endfor %} {% for testname, result in data | first | get(key=latest[0]) %} {% for impl in config.extra.tests.pipelines[name].impl %} {% set lastrun = latest[loop.index0] %} {% endfor %} {% endfor %}
Test{{ impl.name }}
{{ latest[loop.index0] | split(pat="-") | nth(n=0) | int | date(format=trans(key="dateFormat", lang=lang)) }}
{{ testname }} {{ data[loop.index0][lastrun][testname] }}
{% for impl in config.extra.tests.pipelines[name].impl %} {% set suite_index = loop.index0 %}

{{ impl.name }}

{# This is a hack because we can't reverse a map (only arrays) #} {% set_global runs = [] %} {% for key, val in data[suite_index] %}{% set_global runs = runs | concat(with=key) %}{% endfor %} {% for run in runs | reverse %} {# TODO: configure in config.extra how many commits to display #} {% if loop.index > config.extra.tests.number|default(value=10) %}{% break %}{% endif %} {% set date_commit = run | split(pat="-") %}
{{ date_commit[0] | int | date(format=trans(key="dateFormat", lang=lang)) }} (commit {% if config.extra.tests.commiturls %}{{ date_commit[1] }}{% else %}{{ date_commit[1] }}{% endif %})
{% endfor %} {% endfor %} {% endmacro pipeline %}