45
45
]
46
46
)
47
47
48
+ CSV_FIELD_NAMES .append ("Error" )
49
+
48
50
49
51
# Operators that are excluded from the counts returned by count_ops. These are used to
50
52
# exclude operatations that are not logically relevant or delegatable to backends.
@@ -365,6 +367,15 @@ def write_csv_header(output: TextIO):
365
367
def write_csv_row (record : TestCaseSummary , output : TextIO ):
366
368
writer = csv .DictWriter (output , CSV_FIELD_NAMES )
367
369
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
+
368
379
row = {
369
380
"Test ID" : record .name ,
370
381
"Test Case" : record .base_name ,
@@ -373,6 +384,7 @@ def write_csv_row(record: TestCaseSummary, output: TextIO):
373
384
"Params" : _serialize_params (record .params ),
374
385
"Result" : record .result .to_short_str (),
375
386
"Result Detail" : record .result .to_detail_str (),
387
+ "Error" : error_message ,
376
388
"Delegated" : "True" if record .is_delegated () else "False" ,
377
389
"Quantize Time (s)" : (
378
390
f"{ record .quantize_time .total_seconds ():.3f} "
0 commit comments