Skip to content

Commit 0c8e436

Browse files
committed
squash: fix tests
1 parent c423100 commit 0c8e436

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tests/execute/restraint/tmt-abort/test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ rlJournalStart
1414
rlAssertNotGrep "This test should not be executed." $rlRun_LOG
1515
rlAssertNotGrep "This should not be executed either." $rlRun_LOG
1616

17+
1718
rlAssertGrep "result: error" "${run}/plan/execute/results.yaml"
18-
rlAssertGrep "note: aborted" "${run}/plan/execute/results.yaml"
19+
rlAssertEquals "results should record the test aborted" \
20+
"$(yq -r '.[] | .note | join(", ")' ${run}/plan/execute/results.yaml)" \
21+
"beakerlib: State 'started', aborted"
1922
rlPhaseEnd
2023

2124
rlPhaseStartCleanup

tmt/result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ class BaseResult(SerializableContainer):
152152
unserialize=ResultOutcome.from_spec
153153
)
154154
note: list[str] = field(
155-
default_factory=cast(Callable[[], list[str]], list))
155+
default_factory=cast(Callable[[], list[str]], list),
156+
unserialize=lambda value: [] if value is None else value)
156157
log: list[Path] = field(
157158
default_factory=cast(Callable[[], list[Path]], list),
158159
serialize=lambda logs: [str(log) for log in logs],

tmt/steps/report/html/template.html.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Context:
266266
{% endfor %}
267267
</td>
268268
<td class="data"><a href="{{ base_dir | linkable_path | urlencode }}/{{ result.data_path | urlencode }}">data</a></td>
269-
<td class="note">{% if result.note %}{{ result.note | e }}{% else %}-{% endif %}</td>
269+
<td class="note">{% if result.note %}{{ result.printable_note | e }}{% else %}-{% endif %}</td>
270270
<td class="action">
271271
{% if result.check %}
272272
<button onclick="toggle_row_visibility(this, 'check-{{ loop.index }}')" title="Show / hide checks">checks&nbsp;[+]</button>

0 commit comments

Comments
 (0)