Skip to content

Commit

Permalink
squash: change HTML rendering to use a list
Browse files Browse the repository at this point in the history
  • Loading branch information
happz authored and psss committed Jan 10, 2025
1 parent 3a02f29 commit 2026f15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/report/html/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ rlJournalStart
grep -B 1 "/test/$test_name_suffix</td>" $HTML | tee $tmp/$test_name_suffix
rlAssertGrep 'class="result error">error</td>' $tmp/$test_name_suffix -F
sed -e "/name\">\/test\/$test_name_suffix/,/\/tr/!d" $HTML | tee $tmp/$test_name_suffix-note
rlAssertGrep '<td class="note">timeout</td>' $tmp/$test_name_suffix-note -F
rlAssertGrep '<li class="note">timeout</li>' $tmp/$test_name_suffix-note -F

test_name_suffix=xfail
grep -B 1 "/test/$test_name_suffix</td>" $HTML | tee $tmp/$test_name_suffix
rlAssertGrep 'class="result pass">pass</td>' $tmp/$test_name_suffix -F
sed -e "/name\">\/test\/$test_name_suffix/,/\/tr/!d" $HTML | tee $tmp/$test_name_suffix-note
rlAssertGrep '<td class="note">test failed as expected, original test result: fail</td>' $tmp/$test_name_suffix-note -F
rlAssertGrep '<li class="note">test failed as expected</li>' $tmp/$test_name_suffix-note -F
rlAssertGrep '<li class="note">original test result: fail</li>' $tmp/$test_name_suffix-note -F
rlPhaseEnd

if [ "$option" = "" ]; then
Expand Down
12 changes: 11 additions & 1 deletion tmt/steps/report/html/template.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,17 @@ Context:
{% endfor %}
</td>
<td class="data"><a href="{{ base_dir | linkable_path | urlencode }}/{{ result.data_path | urlencode }}">data</a></td>
<td class="note">{% if result.note %}{{ result.printable_note | e }}{% else %}-{% endif %}</td>
<td class="note">
{% if result.note %}
<ul>
{% for note in result.note %}
<li class="note">{{ note | e }}</li>
{% endfor %}
</ul>
{% else %}
-
{% endif %}
</td>
<td class="action">
{% if result.check %}
<button onclick="toggle_row_visibility(this, 'check-{{ loop.index }}')" title="Show / hide checks">checks&nbsp;[+]</button>
Expand Down

0 comments on commit 2026f15

Please sign in to comment.