diff --git a/tests/execute/restraint/tmt-abort/test.sh b/tests/execute/restraint/tmt-abort/test.sh index 3080efdb9c..a4ca7cff0b 100755 --- a/tests/execute/restraint/tmt-abort/test.sh +++ b/tests/execute/restraint/tmt-abort/test.sh @@ -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 diff --git a/tmt/result.py b/tmt/result.py index db168c6881..8dc934df08 100644 --- a/tmt/result.py +++ b/tmt/result.py @@ -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], diff --git a/tmt/steps/report/html/template.html.j2 b/tmt/steps/report/html/template.html.j2 index bb65387806..c7ee14796c 100644 --- a/tmt/steps/report/html/template.html.j2 +++ b/tmt/steps/report/html/template.html.j2 @@ -266,7 +266,7 @@ Context: {% endfor %}