Skip to content

Commit

Permalink
Fix runtime selection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Feb 3, 2023
1 parent 13c484d commit 020b391
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/tests/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class RunContext:
in_unshare: bool
chip_tool: str
dry_run: bool
runtime: TestRunTime

# If not empty, include only the specified test tags
include_tags: set(TestTag) = field(default_factory={})
Expand Down Expand Up @@ -203,6 +204,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob,
context.obj = RunContext(root=root, tests=tests,
in_unshare=internal_inside_unshare,
chip_tool=chip_tool, dry_run=dry_run,
runtime=TestRunTime.PYTHON_YAML if run_yamltests_with_chip_repl else TestRunTime.CHIP_TOOL_BUILTIN,
include_tags=include_tags,
exclude_tags=exclude_tags)

Expand Down Expand Up @@ -310,10 +312,6 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
apps_register = AppsRegister()
apps_register.init()

runtime = TestRunTime.CHIP_TOOL_BUILTIN
if chip_repl_yaml_tester:
runtime = TestRunTime.PYTHON_YAML

for i in range(iterations):
logging.info("Starting iteration %d" % (i+1))
for test in context.obj.tests:
Expand All @@ -336,7 +334,7 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o
logging.info('%-20s - Starting test' % (test.name))
test.Run(
runner, apps_register, paths, pics_file, test_timeout_seconds, context.obj.dry_run,
test_runtime=runtime)
test_runtime=context.obj.runtime)
test_end = time.monotonic()
logging.info('%-30s - Completed in %0.2f seconds' %
(test.name, (test_end - test_start)))
Expand Down

0 comments on commit 020b391

Please sign in to comment.