Skip to content

Commit

Permalink
Adding endpoint information to test steps methods and hooks along wit…
Browse files Browse the repository at this point in the history
…h logging.

Also, the TC_ACE_1_3 and TC_BOOLCFG_2_1 tests were updated to demonstrate how to
used the updated hooks to inform the endpoint associated with every step.
  • Loading branch information
antonio-amjr committed Sep 18, 2024
1 parent 17b1a38 commit 9be444b
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 138 deletions.
4 changes: 3 additions & 1 deletion scripts/py_matter_yamltests/matter_yamltests/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,16 @@ def step_skipped(self, name: str, expression: str):
"""
pass

def step_start(self, request: TestStep):
def step_start(self, request: TestStep, endpoint: Optional[int] = None):
"""
This method is called when the runner starts running a step from the test.
Parameters
----------
request: TestStep
The original request as defined by the test step.
endpoint: int
An optional device endpoint the step will target for.
"""
pass

Expand Down
2 changes: 1 addition & 1 deletion scripts/py_matter_yamltests/matter_yamltests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def _run(self, parser: TestParser, config: TestRunnerConfig):
if config.options.delay_in_ms:
await asyncio.sleep(config.options.delay_in_ms / 1000)

hooks.test_stop(round(test_duration))
hooks.test_stop(exception=None, duration=round(test_duration))

except Exception as exception:
status = exception
Expand Down
Loading

0 comments on commit 9be444b

Please sign in to comment.