@@ -179,6 +179,7 @@ def __init__(self,
179
179
_opts_mut_reset_type = None ,
180
180
_opts_jobs = None ,
181
181
_opts_waterfall_test = None ,
182
+ _opts_consolidate_waterfall_test = None ,
182
183
_opts_extend_test_timeout = None ):
183
184
""" Let's try hard to init this object
184
185
"""
@@ -236,6 +237,7 @@ def __init__(self,
236
237
self .opts_mut_reset_type = _opts_mut_reset_type
237
238
self .opts_jobs = _opts_jobs if _opts_jobs is not None else 1
238
239
self .opts_waterfall_test = _opts_waterfall_test
240
+ self .opts_consolidate_waterfall_test = _opts_consolidate_waterfall_test
239
241
self .opts_extend_test_timeout = _opts_extend_test_timeout
240
242
self .opts_clean = _clean
241
243
@@ -485,18 +487,21 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep
485
487
)
486
488
487
489
# Add detailed test result to test summary structure
488
- if target not in self .test_summary_ext [toolchain ][target ]:
489
- self .test_summary_ext [toolchain ][target ][test_id ] = { 0 : {
490
- 'single_test_result' : self .TEST_RESULT_BUILD_FAILED ,
491
- 'single_test_output' : '' ,
492
- 'target_name' : target ,
493
- 'toolchain_name' : toolchain ,
494
- 'test_id' : test_id ,
495
- 'test_description' : 'Toolchain build failed' ,
496
- 'elapsed_time' : 0 ,
497
- 'duration' : 0 ,
498
- 'copy_method' : None
499
- }}
490
+ if test_id not in self .test_summary_ext [toolchain ][target ]:
491
+ self .test_summary_ext [toolchain ][target ][test_id ] = []
492
+
493
+ self .test_summary_ext [toolchain ][target ][test_id ].append ({ 0 : {
494
+ 'single_test_result' : self .TEST_RESULT_BUILD_FAILED ,
495
+ 'single_test_output' : '' ,
496
+ 'target_name' : target ,
497
+ 'target_name_unique' : target ,
498
+ 'toolchain_name' : toolchain ,
499
+ 'test_id' : test_id ,
500
+ 'test_description' : 'Toolchain build failed' ,
501
+ 'elapsed_time' : 0 ,
502
+ 'duration' : 0 ,
503
+ 'copy_method' : None
504
+ }})
500
505
continue
501
506
502
507
if self .opts_only_build_tests :
@@ -537,7 +542,15 @@ def execute_thread_slice(self, q, target, toolchains, clean, test_ids, build_rep
537
542
if target not in self .test_summary_ext [toolchain ][target ]:
538
543
if test_id not in self .test_summary_ext [toolchain ][target ]:
539
544
self .test_summary_ext [toolchain ][target ][test_id ] = []
540
- self .test_summary_ext [toolchain ][target ][test_id ].append (detailed_test_results )
545
+
546
+ append_test_result = detailed_test_results
547
+
548
+ # If waterfall and consolidate-waterfall options are enabled,
549
+ # only include the last test result in the report.
550
+ if self .opts_waterfall_test and self .opts_consolidate_waterfall_test :
551
+ append_test_result = {0 : detailed_test_results [len (detailed_test_results ) - 1 ]}
552
+
553
+ self .test_summary_ext [toolchain ][target ][test_id ].append (append_test_result )
541
554
542
555
test_suite_properties ['skipped' ] = ', ' .join (test_suite_properties ['skipped' ])
543
556
self .test_suite_properties_ext [target ][toolchain ] = test_suite_properties
@@ -1835,6 +1848,12 @@ def get_default_test_options_parser():
1835
1848
dest = 'test_global_loops_value' ,
1836
1849
help = 'Set global number of test loops per test. Default value is set 1' )
1837
1850
1851
+ parser .add_option ('' , '--consolidate-waterfall' ,
1852
+ dest = 'consolidate_waterfall_test' ,
1853
+ default = False ,
1854
+ action = "store_true" ,
1855
+ help = 'Used with --waterfall option. Adds only one test to report reflecting outcome of waterfall test.' )
1856
+
1838
1857
parser .add_option ('-W' , '--waterfall' ,
1839
1858
dest = 'waterfall_test' ,
1840
1859
default = False ,
0 commit comments