fix: result_detail parser
This commit is contained in:
		
							parent
							
								
									78dc81b864
								
							
						
					
					
						commit
						8d5932801d
					
				|  | @ -254,6 +254,37 @@ def fix_diff( | ||||||
|     return conf_stage |     return conf_stage | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | def fix_result_detail(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage: | ||||||
|  |     if "result-detail" in task_stage.parsers: | ||||||
|  |         result_detail_parser = next( | ||||||
|  |             p for p in conf_stage.parsers if p.name == "result-detail" | ||||||
|  |         ) | ||||||
|  |         if task_stage.result_detail is not None: | ||||||
|  |             show_files = [] | ||||||
|  |             if ( | ||||||
|  |                 task_stage.result_detail.stdout | ||||||
|  |                 and task_stage.result_detail.stdout is not None | ||||||
|  |             ): | ||||||
|  |                 show_files.append("stdout") | ||||||
|  |             if ( | ||||||
|  |                 task_stage.result_detail.stderr | ||||||
|  |                 and task_stage.result_detail.stderr is not None | ||||||
|  |             ): | ||||||
|  |                 show_files.append("stderr") | ||||||
|  |             result_detail_parser.with_.update( | ||||||
|  |                 { | ||||||
|  |                     "score": 0, | ||||||
|  |                     "comment": "", | ||||||
|  |                     "showFiles": show_files, | ||||||
|  |                     "showExitStatus": task_stage.result_detail.exitstatus, | ||||||
|  |                     "showRuntime": task_stage.result_detail.time, | ||||||
|  |                     "showMemory": task_stage.result_detail.mem, | ||||||
|  |                 } | ||||||
|  |             ) | ||||||
|  | 
 | ||||||
|  |     return conf_stage | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| def fix_comment(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage: | def fix_comment(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage: | ||||||
|     comment_parser = [ |     comment_parser = [ | ||||||
|         "dummy", |         "dummy", | ||||||
|  |  | ||||||
|  | @ -238,7 +238,15 @@ | ||||||
|                             "mem": false, |                             "mem": false, | ||||||
|                             "stdout": false, |                             "stdout": false, | ||||||
|                             "stderr": true, |                             "stderr": true, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stderr" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": false, | ||||||
|  |                             "showMemory": false | ||||||
|                         } |                         } | ||||||
|                     }, |                     }, | ||||||
|                     { |                     { | ||||||
|  | @ -375,7 +383,15 @@ | ||||||
|                             "mem": false, |                             "mem": false, | ||||||
|                             "stdout": false, |                             "stdout": false, | ||||||
|                             "stderr": true, |                             "stderr": true, | ||||||
|                             "exitstatus": false |                             "exitstatus": false, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stderr" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": false, | ||||||
|  |                             "showRuntime": false, | ||||||
|  |                             "showMemory": false | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  | @ -559,7 +575,15 @@ | ||||||
|                             "mem": false, |                             "mem": false, | ||||||
|                             "stdout": true, |                             "stdout": true, | ||||||
|                             "stderr": false, |                             "stderr": false, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stdout" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": false, | ||||||
|  |                             "showMemory": false | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  | @ -693,7 +717,15 @@ | ||||||
|                             "mem": false, |                             "mem": false, | ||||||
|                             "stdout": false, |                             "stdout": false, | ||||||
|                             "stderr": true, |                             "stderr": true, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stderr" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": false, | ||||||
|  |                             "showMemory": false | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  | @ -776,16 +808,7 @@ | ||||||
|                     { |                     { | ||||||
|                         "name": "cpplint", |                         "name": "cpplint", | ||||||
|                         "with": { |                         "with": { | ||||||
|                             "keyword": [ |                             "comment": "" | ||||||
|                                 "runtime", |  | ||||||
|                                 "readability", |  | ||||||
|                                 "build" |  | ||||||
|                             ], |  | ||||||
|                             "weight": [ |  | ||||||
|                                 10, |  | ||||||
|                                 20, |  | ||||||
|                                 15 |  | ||||||
|                             ] |  | ||||||
|                         } |                         } | ||||||
|                     }, |                     }, | ||||||
|                     { |                     { | ||||||
|  | @ -801,7 +824,15 @@ | ||||||
|                             "mem": false, |                             "mem": false, | ||||||
|                             "stdout": true, |                             "stdout": true, | ||||||
|                             "stderr": false, |                             "stderr": false, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stdout" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": false, | ||||||
|  |                             "showMemory": false | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  | @ -894,7 +925,15 @@ | ||||||
|                             "mem": true, |                             "mem": true, | ||||||
|                             "stdout": false, |                             "stdout": false, | ||||||
|                             "stderr": true, |                             "stderr": true, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stderr" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": true, | ||||||
|  |                             "showMemory": true | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  | @ -987,7 +1026,15 @@ | ||||||
|                             "mem": true, |                             "mem": true, | ||||||
|                             "stdout": false, |                             "stdout": false, | ||||||
|                             "stderr": true, |                             "stderr": true, | ||||||
|                             "exitstatus": true |                             "exitstatus": true, | ||||||
|  |                             "score": 0, | ||||||
|  |                             "comment": "", | ||||||
|  |                             "showFiles": [ | ||||||
|  |                                 "stderr" | ||||||
|  |                             ], | ||||||
|  |                             "showExitStatus": true, | ||||||
|  |                             "showRuntime": true, | ||||||
|  |                             "showMemory": true | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user