Skip to content

Commit

Permalink
Improve HTML reports.
Browse files Browse the repository at this point in the history
Closes #332
Closes #232
  • Loading branch information
Johannes Ernst committed Dec 17, 2024
1 parent 4ca3304 commit 51249d1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/feditest/testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ def transcribe(self) -> TestRunTranscript:

trans_sessions.append(TestRunSessionTranscript(
run_session.plan_constellation_index,
len(self.run_sessions),
cast(datetime, run_session.started),
cast(datetime, run_session.ended),
trans_constellation,
Expand Down
8 changes: 5 additions & 3 deletions src/feditest/testruntranscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class TestRunSessionTranscript(msgspec.Struct):
Captures information about the run of a single session in a transcript.
"""
run_session_index: int
total_sessions: int
started : datetime
ended : datetime
constellation: TestRunConstellationTranscript
Expand All @@ -315,7 +316,8 @@ def build_summary(self, augment_this: TestRunTranscriptSummary | None = None ):


def __str__(self):
return f"Session {self.run_session_index}"
return f"Test Run Session { self.run_session_index + 1 }/{ self.total_sessions }"
# +1 for what humans expect when it says 1/2


class TestRunTranscript(msgspec.Struct):
Expand Down Expand Up @@ -383,6 +385,6 @@ def has_compatible_version(self):

def __str__(self):
if self.plan.name:
return f'{ self.id } ({ self.plan.name })'
return self.id
return str(self.plan.name)
return 'Test Run'

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html lang="en">
<head>
{% include "partials/shared/head.jinja2" %}
<title>{{ transcript.plan.name | e }} | Feditest</title>
<title>{{ transcript | e }} ({{ transcript.id }}) | Feditest</title>
</head>
<body>
<header class="feditest title">
<h1><span class="prefix"><a href="https://feditest.org/">Feditest</a> Summary Report:</span> {{ transcript.plan.name | e }}</h1>
<h1><span class="prefix"><a href="https://feditest.org/">Feditest</a>:</span> {{ transcript | e }}</h1>
<p class="id">{{ transcript.id }}</p>
</header>
{% include "partials/shared/mobile.jinja2" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
{%- set constellation = run_session.constellation %}
<th>
<div class="title">
<a href="{{ session_file_path(run_session) }}">
<dl class="roles">
<p><a href="{{ session_file_path(run_session) }}">{{ run_session }}</a></p>
<dl class="roles">
{%- for role, node in constellation.nodes.items() %}
<dt>{{ role | e }}</dt>
<dd>{{ node.node_driver | e }}</dd>
<dt>{{ role | e }}</dt>
<dd>{{ node.appdata['app'] | e }}</dd>
{%- endfor %}
</dl>
</a>
</dl>
</div>
</th>
{%- endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
<html lang="en">
<head>
{% include "partials/shared/head.jinja2" %}
<title>{{ run_session.name | e }} | Feditest</title>
<title>{{ run_session | e }} ({{ transcript.id }}) | Feditest</title>
</head>
<body>
<header class="feditest title" style="text-align: center">
<h1><span class="prefix"><a href="https://feditest.org/">Feditest</a> Session Report:</span> {{ run_session | e }}</h1>
<p class="id">{{ transcript.id }} [<a href="{{ matrix_file_path }}">Summary</a>]</p>
</header>

{% include "partials/shared/mobile.jinja2" %}
<header class="feditest title" style="text-align: center">
<h1><span class="prefix"><a href="https://feditest.org/">Feditest</a>:</span> {{ run_session | e }}</h1>
<p class="id">{{ transcript.id }} <a href="{{ matrix_file_path }}">&#x21e7;</a></p>
</header>
{% include "partials/shared/mobile.jinja2" %}
<nav class="feditest matrix">
<ul>
<li><a href="#summary">Summary</a></li>
Expand All @@ -19,14 +18,14 @@
</ul>
</nav>
<div id="summary" class="feditest module summary">
<h2>Test Run Summary</h2>
<h2>Test Run Session Summary</h2>
{% include "partials/shared/summary.jinja2" %}
</div>
<div id="results" class="feditest module results">
{% include "partials/shared_session/results.jinja2" %}
</div>
<div id="metadata" class="feditest module metadata">
<h2>Test Run Metadata</h2>
<h2>Test Run Session Metadata</h2>
{% include "partials/shared_session/metadata.jinja2" %}
</div>
{% include "partials/shared/footer.jinja2" %}
Expand Down

0 comments on commit 51249d1

Please sign in to comment.