From a0c6bfd63c6610e9d0c5f3602902ba5d9a2fb6cf Mon Sep 17 00:00:00 2001 From: jon-lee Date: Tue, 4 Mar 2025 14:52:25 +0800 Subject: [PATCH] feat: result-detail testcase --- tests/convert/basic/task.json | 40 ++++++------ tests/convert/result-detail/repo.toml | 2 + tests/convert/result-detail/task.json | 91 +++++++++++++++++++++++++++ tests/convert/result-detail/task.toml | 18 ++++++ tests/convert/test_convert_cases.py | 4 ++ 5 files changed, 135 insertions(+), 20 deletions(-) create mode 100644 tests/convert/result-detail/repo.toml create mode 100644 tests/convert/result-detail/task.json create mode 100644 tests/convert/result-detail/task.toml diff --git a/tests/convert/basic/task.json b/tests/convert/basic/task.json index 812bd02..bc821d6 100644 --- a/tests/convert/basic/task.json +++ b/tests/convert/basic/task.json @@ -222,11 +222,11 @@ } }, "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-asan": "h7/build/ex2-asan", "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2": "h7/build/ex2" }, "copyInDir": ".", "copyOut": [ @@ -322,11 +322,11 @@ } }, "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-asan": "h7/build/ex2-asan", "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2": "h7/build/ex2" }, "copyInDir": ".", "copyOut": [ @@ -444,11 +444,11 @@ "cpuSetLimit": "", "copyIn": {}, "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-asan": "h7/build/ex2-asan", "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2": "h7/build/ex2" }, "copyInDir": ".", "copyOut": [ @@ -587,11 +587,11 @@ "cpuSetLimit": "", "copyIn": {}, "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-asan": "h7/build/ex2-asan", "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2": "h7/build/ex2" }, "copyInDir": ".", "copyOut": [ @@ -684,11 +684,11 @@ "cpuSetLimit": "", "copyIn": {}, "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-asan": "h7/build/ex2-asan", "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2": "h7/build/ex2" }, "copyInDir": ".", "copyOut": [ diff --git a/tests/convert/result-detail/repo.toml b/tests/convert/result-detail/repo.toml new file mode 100644 index 0000000..2858724 --- /dev/null +++ b/tests/convert/result-detail/repo.toml @@ -0,0 +1,2 @@ +force_skip_health_check_on_test = true +force_skip_teapot_on_test = true diff --git a/tests/convert/result-detail/task.json b/tests/convert/result-detail/task.json new file mode 100644 index 0000000..a9c2768 --- /dev/null +++ b/tests/convert/result-detail/task.json @@ -0,0 +1,91 @@ +{ + "name": "hw7 ex2", + "logPath": "/home/tt/.cache/joj3/homework/h7/e2.log", + "expireUnixTimestamp": 1735574399, + "effectiveUnixTimestamp": 1735487999, + "actorCsvPath": "/home/tt/.config/joj/students.csv", + "maxTotalScore": 100, + "stage": { + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "stages": [ + { + "name": "[cq] Filelength", + "group": "cq", + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/filelength", + "400", + "300", + "*.cpp", + "*.h" + ], + "env": [], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 134217728, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tools/filelength": { + "src": "/home/tt/.config/joj/tools/filelength" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showFiles": [ + "stdout", + "stderr" + ], + "showExitStatus": true, + "showRuntime": false, + "showMemory": false + } + } + ] + } + ], + "preStages": [], + "postStages": [] + } +} diff --git a/tests/convert/result-detail/task.toml b/tests/convert/result-detail/task.toml new file mode 100644 index 0000000..f6eb28c --- /dev/null +++ b/tests/convert/result-detail/task.toml @@ -0,0 +1,18 @@ +# general task configuration +task.name = "hw7 ex2" # task name +task.type = "homework/h7/e2" # remove this task type later + +release.end_time = 2024-12-30 23:59:59+08:00 +release.begin_time = 2024-12-29 23:59:59+08:00 + +[[stages]] +name = "[cq] Filelength" +command = "./tools/filelength 400 300 *.cpp *.h" +files.import = [ "tools/filelength" ] + +parsers = [ "result-detail" ] +result-detail.exitstatus = true +result-detail.stdout = true +result-detail.stderr = true +result-detail.time = false +result-detail.mem = false diff --git a/tests/convert/test_convert_cases.py b/tests/convert/test_convert_cases.py index 94d83d4..514395a 100644 --- a/tests/convert/test_convert_cases.py +++ b/tests/convert/test_convert_cases.py @@ -23,3 +23,7 @@ def test_diff() -> None: def test_keyword() -> None: load_case("keyword") + + +def test_result_detail() -> None: + load_case("result-detail")