Skip to content

Commit

Permalink
Adding interface to handle manual step execution. (project-chip#28741)
Browse files Browse the repository at this point in the history
Manual step execution are meant to be executed outside runner domain. E.g Collecting user feedback through prompt.
  • Loading branch information
gladystonfranca authored and HunsupJung committed Oct 23, 2023
1 parent e553dc6 commit 6b640ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/py_matter_yamltests/matter_yamltests/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ def step_unknown(self):
"""
pass

async def step_manual(self):
"""
This method is called when the step is executed manually.
"""
pass


class WebSocketRunnerHooks():
def connecting(self, url: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def __init__(self, clusters: List[PseudoCluster]):
def supports(self, request) -> bool:
return False if self.__get_command(request) is None else True

def is_manual_step(self, request):
return (request.cluster == LogCommands().name and
request.command == "UserPrompt")

def add(self, cluster: PseudoCluster):
self.clusters.append(cluster)

Expand Down
4 changes: 4 additions & 0 deletions scripts/py_matter_yamltests/matter_yamltests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ async def _run(self, parser: TestParser, config: TestRunnerConfig):
hooks.step_start(request)
hooks.step_unknown()
continue
elif config.pseudo_clusters.is_manual_step(request):
hooks.step_start(request)
await hooks.step_manual()
continue
else:
hooks.step_start(request)

Expand Down

0 comments on commit 6b640ef

Please sign in to comment.