@@ -1196,6 +1196,15 @@ def pop_default(l: list[Any], i: int, default: Any) -> Any:
11961196 "time_spent" : [],
11971197 "failures" : {},
11981198 "job_link" : {},
1199+ "captured_info" : {},
1200+ }
1201+ for matrix_name in job_matrix
1202+ if f"{ report_name_prefix } _{ matrix_name } _test_reports" in available_artifacts
1203+ }
1204+
1205+ matrix_job_results_extra = {
1206+ matrix_name : {
1207+ "captured_info" : {},
11991208 }
12001209 for matrix_name in job_matrix
12011210 if f"{ report_name_prefix } _{ matrix_name } _test_reports" in available_artifacts
@@ -1225,7 +1234,21 @@ def pop_default(l: list[Any], i: int, default: Any) -> Any:
12251234
12261235 stacktraces = handle_stacktraces (artifact ["failures_line" ])
12271236
1228- # TODO: ???
1237+ # Add the captured actual outputs for patched methods (`torch.testing.assert_close`, `assertEqual` etc.)
1238+ if "captured_info" in artifact :
1239+ step_number = None
1240+ for step in job .get ("steps" , []):
1241+ if step ["name" ] == "Captured information" :
1242+ step_number = step ["number" ]
1243+ break
1244+ if step_number is not None :
1245+ step_link = f"{ job ['html_url' ]} #step:{ step_number } :1"
1246+ matrix_job_results [matrix_name ]["captured_info" ][artifact_gpu ] = step_link
1247+ matrix_job_results_extra [matrix_name ]["captured_info" ][artifact_gpu ] = {
1248+ "link" : step_link ,
1249+ "captured_info" : artifact ["captured_info" ],
1250+ }
1251+
12291252 for line in artifact ["summary_short" ].split ("\n " ):
12301253 if line .startswith ("FAILED " ):
12311254 # Avoid the extra `FAILED` entry given by `run_test_using_subprocess` causing issue when calling
@@ -1432,6 +1455,20 @@ def pop_default(l: list[Any], i: int, default: Any) -> Any:
14321455 token = os .environ .get ("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN" , None ),
14331456 )
14341457
1458+ if len (matrix_job_results_extra ) > 0 :
1459+ with open (
1460+ f"ci_results_{ job_name } /{ test_to_result_name [test_name ]} _results_extra.json" , "w" , encoding = "UTF-8"
1461+ ) as fp :
1462+ json .dump (matrix_job_results_extra , fp , indent = 4 , ensure_ascii = False )
1463+
1464+ api .upload_file (
1465+ path_or_fileobj = f"ci_results_{ job_name } /{ test_to_result_name [test_name ]} _results_extra.json" ,
1466+ path_in_repo = f"{ report_repo_folder } /ci_results_{ job_name } /{ test_to_result_name [test_name ]} _results_extra.json" ,
1467+ repo_id = report_repo_id ,
1468+ repo_type = "dataset" ,
1469+ token = os .environ .get ("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN" , None ),
1470+ )
1471+
14351472 # Let's create a file contain job --> job link
14361473 if len (matrix_job_results ) > 0 :
14371474 target_results = matrix_job_results
0 commit comments