Skip to content

Commit d1cd982

Browse files
JordanYatesnashif
authored andcommitted
scripts: twisterlib: display testplan build duration
Display how long it takes to build the testplan in the logs. This can be useful since the duration to bulid the plan can vary wildly depending on the arguments given. Without this information, it is difficult to tell (from CI logs) whether a long execution time is from actually building and running the tests, or just generating the testplan. For example, in a downstream repo: ``` ./zephyr/scripts/twister --integration -iv -T . --dry-run INFO - Building initial testsuite list... INFO - Built testsuite list in 10.58 seconds ``` vs ``` ./zephyr/scripts/twister --integration -iv -T . --dry-run \ --vendor nordic --vendor zephyr INFO - Building initial testsuite list... INFO - Built testsuite list in 201.01 seconds ``` Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent e622bda commit d1cd982

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
import subprocess
1818
import sys
19+
import time
1920
from argparse import Namespace
2021
from collections import OrderedDict
2122
from itertools import islice
@@ -830,6 +831,7 @@ def apply_filters(self, **kwargs):
830831
integration_mode_list = test_config_options.get('integration_mode', [])
831832

832833
logger.info("Building initial testsuite list...")
834+
build_list_start = time.time()
833835

834836
keyed_tests = {}
835837
for _, ts in self.testsuites.items():
@@ -1220,6 +1222,9 @@ def apply_filters(self, **kwargs):
12201222
change_skip_to_error_if_integration(self.options, inst)
12211223
inst.add_missing_case_status(inst.status)
12221224

1225+
build_list_duration = time.time() - build_list_start
1226+
logger.info(f"Built testsuite list in {build_list_duration:.2f} seconds")
1227+
12231228
def _find_required_instance(self, required_app, instance: TestInstance) -> TestInstance | None:
12241229
if req_platform := required_app.get("platform", None):
12251230
platform = self.get_platform(req_platform)

0 commit comments

Comments
 (0)