Skip to content

Commit

Permalink
Few tweeks based on observation running end to end.
Browse files Browse the repository at this point in the history
  • Loading branch information
gladystonfranca committed Nov 13, 2023
1 parent 118cc89 commit b914e19
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
import os
import re
from asyncio import sleep
from multiprocessing.managers import BaseManager
from typing import Any, Type, TypeVar

Expand Down Expand Up @@ -55,7 +56,6 @@ class PythonTestCase(TestCase):

python_test: PythonTest
python_test_version: str
test_finished: bool

def __init__(self, test_case_execution: TestCaseExecution) -> None:
super().__init__(test_case_execution=test_case_execution)
Expand All @@ -65,14 +65,16 @@ def start(self, count: int) -> None:
pass

def stop(self, duration: int) -> None:
pass
if not self.test_stop_called:
self.current_test_step.mark_as_completed()

def test_start(self, filename: str, name: str, count: int) -> None:
pass
# Dont know if it is necessary for python testing (came from chip_tool)
# self.next_step()

def test_stop(self, exception: Exception, duration: int) -> None:
self.test_stop_called = True
self.current_test_step.mark_as_completed()

def step_skipped(self, name: str, expression: str) -> None:
Expand All @@ -98,9 +100,6 @@ def step_failure(
def step_unknown(self) -> None:
self.__runned += 1

Check failure on line 101 in test_collections/sdk_tests/support/python_testing/models/test_case.py

View workflow job for this annotation

GitHub Actions / Mypy

test_collections/sdk_tests/support/python_testing/models/test_case.py#L101

"PythonTestCase" has no attribute "__runned" [attr-defined]

def is_finished(self) -> bool:
return self.test_finished

def __handle_logs(self, logs: Any) -> None:
for log_entry in logs or []:
if not isinstance(log_entry, MatterLog):
Expand Down Expand Up @@ -227,9 +226,14 @@ async def execute(self) -> None:
manager.start()
test_runner_hooks = manager.TestRunnerHooks() # type: ignore
runner_class = RUNNER_CLASS_PATH + RUNNER_CLASS
# TODO Ignoring stream from docker execution until client impl is done
self.chip_tool.send_command(
f"{runner_class} {self.metadata['title']}", prefix=EXECUTABLE
)
f"{runner_class} {self.metadata['title']}",
prefix=EXECUTABLE,
is_stream=True,
is_socket=False,
).output

while ((update := test_runner_hooks.update_test()) is not None) or (
not test_runner_hooks.is_finished()
):
Expand All @@ -252,6 +256,7 @@ def call_function(obj, func_name, kwargs) -> None: # type: ignore
call_function(self, func_name, kwargs)

handle_update(update)
await sleep(0.1)
finally:
pass

Expand Down

0 comments on commit b914e19

Please sign in to comment.