Skip to content

Commit

Permalink
Warning if SUT doesn't support parallel execution
Browse files Browse the repository at this point in the history
  • Loading branch information
acerv committed Nov 3, 2023
1 parent edc72a5 commit 181ea09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libkirk/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ async def run(
async with self._run_lock:
await libkirk.events.fire("session_started", self._tmpdir.abspath)

if not self._sut.parallel_execution:
await libkirk.events.fire(
"session_warning",
"SUT doesn't support parallel execution")

try:
await self._start_sut()

Expand Down
4 changes: 4 additions & 0 deletions libkirk/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, no_colors: bool = False) -> None:
libkirk.events.register("run_cmd_stop", self.run_cmd_stop)
libkirk.events.register("suite_started", self.suite_started)
libkirk.events.register("suite_completed", self.suite_completed)
libkirk.events.register("session_warning", self.session_warning)
libkirk.events.register("session_error", self.session_error)
libkirk.events.register("internal_error", self.internal_error)

Expand Down Expand Up @@ -158,6 +159,9 @@ async def suite_timeout(self, suite: Suite, timeout: float) -> None:
f"Suite '{suite.name}' timed out after {timeout} seconds",
color=self.RED)

async def session_warning(self, msg: str) -> None:
self._print(f"Warning: {msg}", color=self.YELLOW)

async def session_error(self, error: str) -> None:
self._print(f"Error: {error}", color=self.RED)

Expand Down

0 comments on commit 181ea09

Please sign in to comment.