4545 ]
4646 )
4747
48+ CSV_FIELD_NAMES .append ("Error" )
49+
4850
4951# Operators that are excluded from the counts returned by count_ops. These are used to
5052# exclude operatations that are not logically relevant or delegatable to backends.
@@ -365,6 +367,15 @@ def write_csv_header(output: TextIO):
365367def write_csv_row (record : TestCaseSummary , output : TextIO ):
366368 writer = csv .DictWriter (output , CSV_FIELD_NAMES )
367369
370+ # Truncate error message if it's too long, keeping first and last 200 characters
371+ error_message = ""
372+ if record .error is not None :
373+ error_str = str (record .error )
374+ if len (error_str ) > 400 :
375+ error_message = error_str [:200 ] + "..." + error_str [- 200 :]
376+ else :
377+ error_message = error_str
378+
368379 row = {
369380 "Test ID" : record .name ,
370381 "Test Case" : record .base_name ,
@@ -373,6 +384,7 @@ def write_csv_row(record: TestCaseSummary, output: TextIO):
373384 "Params" : _serialize_params (record .params ),
374385 "Result" : record .result .to_short_str (),
375386 "Result Detail" : record .result .to_detail_str (),
387+ "Error" : error_message ,
376388 "Delegated" : "True" if record .is_delegated () else "False" ,
377389 "Quantize Time (s)" : (
378390 f"{ record .quantize_time .total_seconds ():.3f} "
0 commit comments