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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-05-10 13:59:43 -04:00
commit bd1b364c2e
2 changed files with 12 additions and 5 deletions

View file

@ -3045,7 +3045,7 @@ class TestPlan(DisablePyTestCollectionMixin):
self.enable_ubsan = False
self.enable_lsan = False
self.enable_asan = False
self.no_skipped_report = False
self.detailed_skipped_report = False
self.enable_valgrind = False
self.extra_args = []
self.inline_logs = False
@ -3926,7 +3926,7 @@ class TestPlan(DisablePyTestCollectionMixin):
suites_to_report = all_suites
# do not create entry if everything is filtered out
if self.no_skipped_report:
if not self.detailed_skipped_report:
suites_to_report = list(filter(lambda d: d.get('status') != "filtered", all_suites))
for suite in suites_to_report:
@ -3996,7 +3996,7 @@ class TestPlan(DisablePyTestCollectionMixin):
for platform in selected:
suites = list(filter(lambda d: d['platform'] == platform, all_suites))
# do not create entry if everything is filtered out
if self.no_skipped_report:
if not self.detailed_skipped_report:
non_filtered = list(filter(lambda d: d.get('status') != "filtered", suites))
if not non_filtered:
continue
@ -4023,7 +4023,7 @@ class TestPlan(DisablePyTestCollectionMixin):
ts_status = ts.get('status')
# Do not report filtered testcases
if ts_status == 'filtered' and self.no_skipped_report:
if ts_status == 'filtered' and not self.detailed_skipped_report:
continue
if full_report:
for tc in ts.get("testcases", []):

View file

@ -548,11 +548,18 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
help="Re-use the outdir before building. Will result in "
"faster compilation since builds will be incremental.")
# To be removed in favor of --detailed-skipped-report
parser.add_argument(
"--no-skipped-report", action="store_true",
help="""Do not report skipped test cases in junit output. [Experimental]
""")
parser.add_argument(
"--detailed-skipped-report", action="store_true",
help="Generate a detailed report with all skipped test cases"
"including those that are filtered based on testsuite definition."
)
parser.add_argument(
"-O", "--outdir",
default=os.path.join(os.getcwd(), "twister-out"),
@ -922,7 +929,7 @@ def main():
tplan.overflow_as_errors = options.overflow_as_errors
tplan.suite_name_check = not options.disable_suite_name_check
tplan.seed = options.seed
tplan.no_skipped_report = options.no_skipped_report
tplan.detailed_skipped_report = options.detailed_skipped_report
# get all enabled west projects
west_proj = west_projects()