Skip to content

Commit

Permalink
squash: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Oct 22, 2024
1 parent 77c8dce commit 084e24a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/execute/restraint/tmt-abort/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ rlJournalStart
rlAssertNotGrep "This test should not be executed." $rlRun_LOG
rlAssertNotGrep "This should not be executed either." $rlRun_LOG


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

rlPhaseStartCleanup
Expand Down
3 changes: 2 additions & 1 deletion tmt/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class BaseResult(SerializableContainer):
unserialize=ResultOutcome.from_spec
)
note: list[str] = field(
default_factory=cast(Callable[[], list[str]], list))
default_factory=cast(Callable[[], list[str]], list),
unserialize=lambda value: [] if value is None else value)
log: list[Path] = field(
default_factory=cast(Callable[[], list[Path]], list),
serialize=lambda logs: [str(log) for log in logs],
Expand Down
2 changes: 1 addition & 1 deletion tmt/steps/report/html/template.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ 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.note | e }}{% else %}-{% endif %}</td>
<td class="note">{% if result.note %}{{ result.printable_note | e }}{% 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 084e24a

Please sign in to comment.