Configure tests page from config.toml
This commit is contained in:
parent
3fe34a79ad
commit
f24977c14d
11
config.toml
11
config.toml
|
@ -33,6 +33,17 @@ home = "https://tildegit.org/"
|
|||
# Name of the forge
|
||||
name = "tildegit"
|
||||
|
||||
[extra.tests]
|
||||
# Where to find tests results ($directory/$suite/results.toml)
|
||||
# Path from static/ directory, no trailing /
|
||||
directory = "tests"
|
||||
# If there are several test suites, declare them here
|
||||
suites = [ "forgebuild.sh", "forgebuild.rs" ]
|
||||
# The number of latest runs to display
|
||||
number = 3
|
||||
# Repositories the commits originate from
|
||||
commiturls = [ "https://tildegit.org/forge/build.sh/commit/", "https://tildegit.org/forge/build.rs/commit/" ]
|
||||
|
||||
[translations]
|
||||
[translations.fr]
|
||||
source = "Source de cette page"
|
||||
|
|
|
@ -2,23 +2,18 @@
|
|||
{% block title %}{{ page.title }}{% endblock title %}
|
||||
{% block main %}
|
||||
<h2>forgebuild</h2>
|
||||
{% set suites = [ "forgebuild.sh", "forgebuild.rs" ] %}
|
||||
{% set directory = "tests" %}
|
||||
{% set bash_data = load_data(path="static/"~directory~"/forgebuild.sh/results.toml") %}
|
||||
{% set bash_latest = load_data(path="static/"~directory~"/forgebuild.sh/latest") %}
|
||||
{% set rust_data = load_data(path="static/tests/forgebuild.rs/results.toml") %}
|
||||
{% set latest = [] %}
|
||||
{% set_global data = [] %}
|
||||
{% for suite in suites %}
|
||||
{% set data = [] %}
|
||||
{% for suite in config.extra.tests.suites %}
|
||||
{# Don't forget to trim() to remove confusing trailing newline #}
|
||||
{% set_global latest = latest | concat(with=load_data(path="static/"~directory~"/"~suite~"/latest")|trim()) %}
|
||||
{% set_global data = data | concat(with=load_data(path="static/"~directory~"/"~suite~"/results.toml")) %}
|
||||
{% set_global latest = latest | concat(with=load_data(path="static/"~config.extra.tests.directory~"/"~suite~"/latest")|trim()) %}
|
||||
{% set_global data = data | concat(with=load_data(path="static/"~config.extra.tests.directory~"/"~suite~"/results.toml")) %}
|
||||
{% endfor %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Test</th>
|
||||
{% for suite in suites %}
|
||||
{% for suite in config.extra.tests.suites %}
|
||||
<th>{{ suite }}
|
||||
<br>{{ latest[loop.index0] | split(pat="-") | nth(n=0) | int | date(format=trans(key="dateFormat", lang=lang)) }}
|
||||
</th>
|
||||
|
@ -28,10 +23,10 @@
|
|||
{% for testname, result in data | first | get(key=latest[0]) %}
|
||||
<tr>
|
||||
<td>{{ testname }}</td>
|
||||
{% for suite in suites %}
|
||||
{% for suite in config.extra.tests.suites %}
|
||||
{% set lastrun = latest[loop.index0] %}
|
||||
<td>
|
||||
<a href="{{ get_url(path=directory~"/"~suite~"/"~lastrun|split(pat="-")|nth(n=0)) }}">
|
||||
<a href="{{ get_url(path=config.extra.tests.directory~"/"~suite~"/"~lastrun|split(pat="-")|nth(n=0)) }}">
|
||||
{{ data[loop.index0][lastrun][testname] }}
|
||||
</a>
|
||||
</td>
|
||||
|
@ -40,7 +35,7 @@
|
|||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% for suite in suites %}
|
||||
{% for suite in config.extra.tests.suites %}
|
||||
{% set suite_index = loop.index0 %}
|
||||
|
||||
<h2>{{ suite }}</h2>
|
||||
|
@ -50,10 +45,10 @@
|
|||
|
||||
{% for run in runs | reverse %}
|
||||
{# TODO: configure in config.extra how many commits to display #}
|
||||
{% if loop.index > 2 %}{% break %}{% endif %}
|
||||
{% if loop.index > config.extra.tests.number|default(value=10) %}{% break %}{% endif %}
|
||||
{% set date_commit = run | split(pat="-") %}
|
||||
<details class="testrun">
|
||||
<summary><a href="{{ get_url(path=directory~"/"~suite~"/" ~ date_commit.0) }}">{{ date_commit[0] | int | date(format=trans(key="dateFormat", lang=lang)) }} ({{ date_commit[1] }})</a></summary>
|
||||
<summary><a href="{{ get_url(path=config.extra.tests.directory~"/"~suite~"/" ~ date_commit.0) }}">{{ date_commit[0] | int | date(format=trans(key="dateFormat", lang=lang)) }}</a> (commit {% if config.extra.tests.commiturls %}<a href="{{ config.extra.tests.commiturls[suite_index] }}{{ date_commit[1] }}">{{ date_commit[1] }}</a>{% else %}{{ date_commit[1] }}{% endif %})</summary>
|
||||
<ul>
|
||||
{% for testname, result in data[suite_index][run] %}
|
||||
<li>{{ result }} {{ testname }}</li>
|
||||
|
|
Loading…
Reference in New Issue