Skip to content

Commit

Permalink
Subsuite status FAILED based on verdict/outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
andmat900 committed May 28, 2024
1 parent 079f8e0 commit 03e4079
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion projects/etos_suite_runner/src/etos_suite_runner/lib/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class SubSuite(OpenTelemetryBase): # pylint:disable=too-many-instance-attribute
"""Handle test results and tracking of a single sub suite."""

released = False
failed = False
_failed = False
_failed_flag_set = False

def __init__(self, etos: ETOS, environment: dict, main_suite_id: str) -> None:
"""Initialize a sub suite."""
Expand All @@ -60,6 +61,21 @@ def __init__(self, etos: ETOS, environment: dict, main_suite_id: str) -> None:
self.test_suite_started = {}
self.test_suite_finished = {}

@property
def failed(self) -> bool:
"""Property indicating whether the sub-suite has had failures."""
if self._failed_flag_set:
return self._failed
verdict = self.outcome().get("verdict")
conclusion = self.outcome().get("conclusion")
return "FAILED" in (verdict, conclusion)

@failed.setter
def failed(self, value: bool) -> None:
"""Setter for the 'failed' property."""
self._failed = value
self._failed_flag_set = True

@property
def finished(self) -> bool:
"""Whether or not this sub suite has finished."""
Expand Down

0 comments on commit 03e4079

Please sign in to comment.