Skip to content

Commit

Permalink
Propagate result phase into report plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
seberm committed Jul 18, 2024
1 parent a23fc47 commit 186adba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tmt/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def show(self) -> str:
return ' '.join(components)


@dataclasses.dataclass
class PhaseResult(BaseResult):
""" Describes what tmt knows about a single test phase result (sub-result) """


@dataclasses.dataclass
class CheckResult(BaseResult):
""" Describes what tmt knows about a single test check result """
Expand Down Expand Up @@ -159,6 +164,13 @@ class Result(BaseResult):
unserialize=lambda serialized: ResultGuestData.from_serialized(serialized)
)

phase: list[PhaseResult] = field(
default_factory=cast(Callable[[], list[PhaseResult]], list),
serialize=lambda results: [result.to_serialized() for result in results],
unserialize=lambda serialized: [
PhaseResult.from_serialized(phase) for phase in serialized]
)

check: list[CheckResult] = field(
default_factory=cast(Callable[[], list[CheckResult]], list),
serialize=lambda results: [result.to_serialized() for result in results],
Expand Down

0 comments on commit 186adba

Please sign in to comment.