feat: cases data reading for diff

This commit is contained in:
李衍志523370910113 2024-10-26 13:49:07 +08:00
parent 8d5932801d
commit ad35dffbaf
2 changed files with 22 additions and 49 deletions

View File

@ -255,7 +255,7 @@ def fix_diff(
def fix_result_detail(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage:
if "result-detail" in task_stage.parsers:
if (task_stage.parsers is not None) and ("result-detail" in task_stage.parsers):
result_detail_parser = next(
p for p in conf_stage.parsers if p.name == "result-detail"
)
@ -291,13 +291,21 @@ def fix_comment(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage:
"result-status",
"cpplint",
] # FIXME: determine where cpplint should be
for parser in task_stage.parsers:
if parser in comment_parser:
comment_parser_ = next(p for p in conf_stage.parsers if p.name == parser)
if getattr(task_stage, parser.replace("-", "_"), None) is not None:
comment_parser_.with_.update(
getattr(task_stage, parser.replace("-", "_"))
if task_stage.parsers is not None:
for parser in task_stage.parsers:
if parser in comment_parser:
comment_parser_ = next(
p for p in conf_stage.parsers if p.name == parser
)
else:
continue
if getattr(task_stage, parser.replace("-", "_"), None) is not None:
comment_parser_.with_.update(
getattr(task_stage, parser.replace("-", "_"))
)
else:
continue
return conf_stage
def fix_diff(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage:
return conf_stage

View File

@ -1,6 +1,6 @@
{
"name": "Homework 1 exercise 2",
"logPath": "Homework-1-exercise-2.log",
"name": "h4 ex1",
"logPath": "h4-ex1.log",
"expireUnixTimestamp": 1728748740,
"stage": {
"sandboxExecServer": "172.17.0.1:5051",
@ -234,11 +234,6 @@
{
"name": "result-detail",
"with": {
"time": false,
"mem": false,
"stdout": false,
"stderr": true,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -379,11 +374,6 @@
{
"name": "result-detail",
"with": {
"time": false,
"mem": false,
"stdout": false,
"stderr": true,
"exitstatus": false,
"score": 0,
"comment": "",
"showFiles": [
@ -571,11 +561,6 @@
{
"name": "result-detail",
"with": {
"time": false,
"mem": false,
"stdout": true,
"stderr": false,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -713,11 +698,6 @@
{
"name": "result-detail",
"with": {
"time": false,
"mem": false,
"stdout": false,
"stderr": true,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -820,11 +800,6 @@
{
"name": "result-detail",
"with": {
"time": false,
"mem": false,
"stdout": true,
"stderr": false,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -921,11 +896,6 @@
{
"name": "result-detail",
"with": {
"time": true,
"mem": true,
"stdout": false,
"stderr": true,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -1022,11 +992,6 @@
{
"name": "result-detail",
"with": {
"time": true,
"mem": true,
"stdout": false,
"stderr": true,
"exitstatus": true,
"score": 0,
"comment": "",
"showFiles": [
@ -1042,9 +1007,9 @@
]
},
"teapot": {
"logPath": "Homework-1-exercise-2-joint-teapot-debug.log",
"scoreboardPath": "Homework-1-exercise-2-scoreboard.csv",
"failedTablePath": "Homework-1-exercise-2-failed-table.md",
"logPath": "h4-ex1-joint-teapot-debug.log",
"scoreboardPath": "h4-ex1-scoreboard.csv",
"failedTablePath": "h4-ex1-failed-table.md",
"gradingRepoName": "engr151-joj",
"skipIssue": false,
"skipScoreboard": false,