Skip to content

Commit bd1b364

Browse files
committed
twister: do not report filtered tests by default
Filtered tests are now not being reported by default to allow generation of reports that are easier to parse and work with in different tools. The complete filtered set of tests is still available in the json output for review and verification. Signed-off-by: Anas Nashif <[email protected]>
1 parent 0313c5c commit bd1b364

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

scripts/pylib/twister/twisterlib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ def __init__(self, board_root_list=[], testsuite_roots=[], outdir=None):
30453045
self.enable_ubsan = False
30463046
self.enable_lsan = False
30473047
self.enable_asan = False
3048-
self.no_skipped_report = False
3048+
self.detailed_skipped_report = False
30493049
self.enable_valgrind = False
30503050
self.extra_args = []
30513051
self.inline_logs = False
@@ -3926,7 +3926,7 @@ def xunit_report_suites(self, json_file, filename):
39263926

39273927
suites_to_report = all_suites
39283928
# do not create entry if everything is filtered out
3929-
if self.no_skipped_report:
3929+
if not self.detailed_skipped_report:
39303930
suites_to_report = list(filter(lambda d: d.get('status') != "filtered", all_suites))
39313931

39323932
for suite in suites_to_report:
@@ -3996,7 +3996,7 @@ def xunit_report(self, json_file, filename, selected_platform=None, full_report=
39963996
for platform in selected:
39973997
suites = list(filter(lambda d: d['platform'] == platform, all_suites))
39983998
# do not create entry if everything is filtered out
3999-
if self.no_skipped_report:
3999+
if not self.detailed_skipped_report:
40004000
non_filtered = list(filter(lambda d: d.get('status') != "filtered", suites))
40014001
if not non_filtered:
40024002
continue
@@ -4023,7 +4023,7 @@ def xunit_report(self, json_file, filename, selected_platform=None, full_report=
40234023

40244024
ts_status = ts.get('status')
40254025
# Do not report filtered testcases
4026-
if ts_status == 'filtered' and self.no_skipped_report:
4026+
if ts_status == 'filtered' and not self.detailed_skipped_report:
40274027
continue
40284028
if full_report:
40294029
for tc in ts.get("testcases", []):

scripts/twister

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,18 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
548548
help="Re-use the outdir before building. Will result in "
549549
"faster compilation since builds will be incremental.")
550550

551+
# To be removed in favor of --detailed-skipped-report
551552
parser.add_argument(
552553
"--no-skipped-report", action="store_true",
553554
help="""Do not report skipped test cases in junit output. [Experimental]
554555
""")
555556

557+
parser.add_argument(
558+
"--detailed-skipped-report", action="store_true",
559+
help="Generate a detailed report with all skipped test cases"
560+
"including those that are filtered based on testsuite definition."
561+
)
562+
556563
parser.add_argument(
557564
"-O", "--outdir",
558565
default=os.path.join(os.getcwd(), "twister-out"),
@@ -922,7 +929,7 @@ def main():
922929
tplan.overflow_as_errors = options.overflow_as_errors
923930
tplan.suite_name_check = not options.disable_suite_name_check
924931
tplan.seed = options.seed
925-
tplan.no_skipped_report = options.no_skipped_report
932+
tplan.detailed_skipped_report = options.detailed_skipped_report
926933

927934
# get all enabled west projects
928935
west_proj = west_projects()

0 commit comments

Comments
 (0)