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

[matter_yamltests] Do not include the pre/post processing to the test… #26680

Merged
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
16 changes: 12 additions & 4 deletions scripts/py_matter_yamltests/matter_yamltests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def run(self, parser_builder_config: TestParserBuilderConfig, runner_config: Tes
continue

loop = asyncio.get_event_loop()
result = loop.run_until_complete(asyncio.wait_for(
self._run(parser, runner_config), parser.timeout))
result = loop.run_until_complete(
self._run_with_timeout(parser, runner_config))
if isinstance(result, Exception):
raise (result)
elif not result:
Expand All @@ -157,11 +157,20 @@ def run(self, parser_builder_config: TestParserBuilderConfig, runner_config: Tes

return parser_builder.done

async def _run(self, parser: TestParser, config: TestRunnerConfig):
async def _run_with_timeout(self, parser: TestParser, config: TestRunnerConfig):
status = True
try:
await self.start()
status = await asyncio.wait_for(self._run(parser, config), parser.timeout)
except Exception as exception:
status = exception
finally:
await self.stop()
return status

async def _run(self, parser: TestParser, config: TestRunnerConfig):
status = True
try:
hooks = config.hooks
hooks.test_start(parser.filename, parser.name, parser.tests.count)

Expand Down Expand Up @@ -214,5 +223,4 @@ async def _run(self, parser: TestParser, config: TestRunnerConfig):
except Exception as exception:
status = exception
finally:
await self.stop()
return status