Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding interface to handle manual step execution. #28741

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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