@@ -38,6 +38,7 @@ class Input:
38
38
no_meta : bool
39
39
no_transform : bool
40
40
no_color : bool
41
+ ignore_warnings : bool
41
42
42
43
43
44
class Color :
@@ -188,6 +189,12 @@ def parse_args() -> Input:
188
189
action = "store_true" ,
189
190
help = "Disables all colors and styles" ,
190
191
)
192
+ p .add_argument (
193
+ "-iw" ,
194
+ "--ignore-warnings" ,
195
+ action = "store_true" ,
196
+ help = "Ignore warnings like checkbox's sleep_test_log_check.py" ,
197
+ )
191
198
192
199
out = p .parse_args ()
193
200
# have to wait until out.filename is populated
@@ -501,9 +508,14 @@ def print_summary_for_1_submission(
501
508
msg = transform_err_msg (
502
509
log_file_lines [error_msg_i ]
503
510
)
504
- failed_runs [ fail_type ][ boot_i ][ suspend_i ]. add ( msg )
511
+ # handler iter earlier to avoid ugly if condition
505
512
error_msg_i += 1
506
513
514
+ if args .ignore_warnings and "Warning:" in msg :
515
+ # literally how the original test case filters warnings
516
+ continue
517
+ failed_runs [fail_type ][boot_i ][suspend_i ].add (msg )
518
+
507
519
if args .write_individual_files :
508
520
print (
509
521
f"Writing boot_{ boot_i } _suspend_{ suspend_i } .txt..." ,
@@ -569,17 +581,19 @@ def main():
569
581
else :
570
582
transform_err_msg = default_err_msg_transform
571
583
572
- print (
573
- C .medium ("[ WARN ]" ),
574
- "The summary file might not match" ,
575
- "the number of failures found by this script." ,
576
- )
577
- print (
578
- C .medium ("[ WARN ]" ),
579
- "Please double check since the original test case" ,
580
- "may consider some failures to be not worth reporting" ,
581
- )
582
- print ()
584
+ if not args .ignore_warnings :
585
+ print (
586
+ C .medium ("[ WARN ]" ),
587
+ "The test summary file might show less errors than this script." ,
588
+ )
589
+ print (
590
+ C .medium ("[ WARN ]" ),
591
+ "Please double check since the original test case" ,
592
+ "has the --ignore-warning flag enabled." ,
593
+ )
594
+ print ()
595
+ else :
596
+ print (C .low ("[ INFO ]" ), "Ignoring fwts warnings" )
583
597
584
598
for filename in args .filenames :
585
599
print_summary_for_1_submission (args , filename , transform_err_msg )
0 commit comments