From e4246ecf45e1d29e30208f192a6c5b9d24a057a6 Mon Sep 17 00:00:00 2001 From: jon-lee Date: Tue, 18 Mar 2025 15:46:01 +0800 Subject: [PATCH] feat(diff): add auto detect testcases feature --- joj3_config_generator/transformers/task.py | 45 ++- tests/convert/clang-tidy/task.json | 155 ++++++++++- tests/convert/cppcheck/task.json | 155 ++++++++++- tests/convert/cpplint/task.json | 155 ++++++++++- tests/convert/diff/case0.in | 0 tests/convert/diff/case1.in | 0 tests/convert/diff/case2.in | 0 tests/convert/diff/case3.in | 0 tests/convert/diff/task.json | 291 +++++++++++++++++++- tests/convert/diff/task1/subtask1/task5.in | 0 tests/convert/diff/task1/subtask1/task5.out | 0 tests/convert/diff/task1/subtask1/task6.in | 0 tests/convert/diff/task1/subtask1/task6.out | 0 tests/convert/diff/task1/task1.in | 0 tests/convert/diff/task1/task1.out | 0 tests/convert/diff/task1/task2.in | 0 tests/convert/diff/task1/task2.out | 0 tests/convert/diff/task2/task3.in | 0 tests/convert/diff/task2/task3.out | 0 tests/convert/diff/task2/task4.in | 0 tests/convert/diff/task2/task4.out | 0 tests/convert/keyword/task.json | 155 ++++++++++- tests/convert/result-detail/task.json | 155 ++++++++++- 23 files changed, 1100 insertions(+), 11 deletions(-) create mode 100644 tests/convert/diff/case0.in create mode 100644 tests/convert/diff/case1.in create mode 100644 tests/convert/diff/case2.in create mode 100644 tests/convert/diff/case3.in create mode 100644 tests/convert/diff/task1/subtask1/task5.in create mode 100644 tests/convert/diff/task1/subtask1/task5.out create mode 100644 tests/convert/diff/task1/subtask1/task6.in create mode 100644 tests/convert/diff/task1/subtask1/task6.out create mode 100644 tests/convert/diff/task1/task1.in create mode 100644 tests/convert/diff/task1/task1.out create mode 100644 tests/convert/diff/task1/task2.in create mode 100644 tests/convert/diff/task1/task2.out create mode 100644 tests/convert/diff/task2/task3.in create mode 100644 tests/convert/diff/task2/task3.out create mode 100644 tests/convert/diff/task2/task4.in create mode 100644 tests/convert/diff/task2/task4.out diff --git a/joj3_config_generator/transformers/task.py b/joj3_config_generator/transformers/task.py index 04158b1..066b82a 100644 --- a/joj3_config_generator/transformers/task.py +++ b/joj3_config_generator/transformers/task.py @@ -2,7 +2,7 @@ import re import shlex from functools import partial from pathlib import Path -from typing import Any, Callable, Dict, List, Tuple +from typing import Any, Callable, Dict, List, Set, Tuple from joj3_config_generator.models import result, task from joj3_config_generator.models.common import Memory, Time @@ -32,7 +32,8 @@ def get_conf_stage( parser_handler_map = get_parser_handler_map( task_stage, conf_stage.executor, - JOJ3_CONFIG_ROOT / task_conf.path.parent, + task_conf.root, + task_conf.path, ) for idx, parser in enumerate(task_stage.parsers): if parser not in parser_handler_map: @@ -45,7 +46,8 @@ def get_conf_stage( def get_parser_handler_map( task_stage: task.Stage, diff_executor_config: result.Executor, - base_dir: Path, + task_root: Path, + task_path: Path, ) -> Dict[ParserEnum, Tuple[Callable[[Any, result.Parser], None], Any]]: return { ParserEnum.CLANG_TIDY: (fix_keyword, task_stage.clangtidy), @@ -61,7 +63,8 @@ def get_parser_handler_map( fix_diff, task_stage=task_stage, diff_executor_config=diff_executor_config, - base_dir=base_dir, + task_root=task_root, + task_path=task_path, ), task_stage.diff, ), @@ -159,13 +162,18 @@ def fix_diff( diff_parser_config: result.Parser, task_stage: task.Stage, diff_executor_config: result.Executor, - base_dir: Path, + task_root: Path, + task_path: Path, ) -> None: + base_dir = JOJ3_CONFIG_ROOT / task_path.parent valid_cases = ( (case, task_stage.cases[case]) for case in task_stage.cases if case not in task_stage.skip and case in task_stage.cases ) + testcases = get_testcases(task_root, task_path) + # TODO: better filter strategy + default_cases = testcases.difference(task_stage.cases) stage_cases = [] parser_cases = [] for case, case_stage in valid_cases: @@ -195,5 +203,32 @@ def fix_diff( ] ) ) + for case in default_cases: + stage_cases.append( + result.OptionalCmd(stdin=result.LocalFile(src=str(base_dir / f"{case}.in"))) + ) + parser_cases.append( + result.DiffCasesConfig( + outputs=[ + result.DiffOutputConfig( + # TODO: how to balance a good score strategy + score=5, # default score + file_name="stdout", + answer_path=str(base_dir / f"{case}.out"), + ) + ] + ) + ) diff_executor_config.with_.cases = stage_cases diff_parser_config.with_ = result.DiffConfig(name="diff", cases=parser_cases) + + +def get_testcases( + task_root: Path, task_path: Path +) -> Set[str]: # basedir here should be task_conf.root / task_conf.path + testcases = set() + for testcases_path in (task_root / task_path).parent.glob("**/*.in"): + testcases.add( + str(testcases_path.relative_to(task_path.parent)).removesuffix(".in") + ) + return testcases diff --git a/tests/convert/clang-tidy/task.json b/tests/convert/clang-tidy/task.json index 5c9b30e..2c207ef 100644 --- a/tests/convert/clang-tidy/task.json +++ b/tests/convert/clang-tidy/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Clang-tidy", "group": "cq", @@ -135,6 +221,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } } diff --git a/tests/convert/cppcheck/task.json b/tests/convert/cppcheck/task.json index bc2d317..144796d 100644 --- a/tests/convert/cppcheck/task.json +++ b/tests/convert/cppcheck/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Cppcheck", "group": "cq", @@ -105,6 +191,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } } diff --git a/tests/convert/cpplint/task.json b/tests/convert/cpplint/task.json index 8fdb56f..6ffe678 100644 --- a/tests/convert/cpplint/task.json +++ b/tests/convert/cpplint/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Cpplint", "group": "cq", @@ -107,6 +193,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } } diff --git a/tests/convert/diff/case0.in b/tests/convert/diff/case0.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/case1.in b/tests/convert/diff/case1.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/case2.in b/tests/convert/diff/case2.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/case3.in b/tests/convert/diff/case3.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task.json b/tests/convert/diff/task.json index d50060f..c4bb518 100644 --- a/tests/convert/diff/task.json +++ b/tests/convert/diff/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[joj] ex2-asan", "group": "joj", @@ -79,6 +165,46 @@ "clockLimit": 4000000000, "memoryLimit": 4194304, "procLimit": 50 + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/task1.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/task5.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/task3.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/task6.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/case3.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/task4.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/case2.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/task2.in" + } } ] } @@ -112,6 +238,102 @@ "compareSpace": false } ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/task1.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/task5.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/task3.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/task6.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case3.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/task4.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case2.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "fileName": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/task2.out", + "forceQuitOnDiff": false, + "alwaysHide": false, + "compareSpace": false + } + ] } ] } @@ -133,6 +355,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } } diff --git a/tests/convert/diff/task1/subtask1/task5.in b/tests/convert/diff/task1/subtask1/task5.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/subtask1/task5.out b/tests/convert/diff/task1/subtask1/task5.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/subtask1/task6.in b/tests/convert/diff/task1/subtask1/task6.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/subtask1/task6.out b/tests/convert/diff/task1/subtask1/task6.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/task1.in b/tests/convert/diff/task1/task1.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/task1.out b/tests/convert/diff/task1/task1.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/task2.in b/tests/convert/diff/task1/task2.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task1/task2.out b/tests/convert/diff/task1/task2.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task2/task3.in b/tests/convert/diff/task2/task3.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task2/task3.out b/tests/convert/diff/task2/task3.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task2/task4.in b/tests/convert/diff/task2/task4.in new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/diff/task2/task4.out b/tests/convert/diff/task2/task4.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/convert/keyword/task.json b/tests/convert/keyword/task.json index 355db46..88f6a61 100644 --- a/tests/convert/keyword/task.json +++ b/tests/convert/keyword/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Filelength", "group": "cq", @@ -104,6 +190,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } } diff --git a/tests/convert/result-detail/task.json b/tests/convert/result-detail/task.json index cd060e1..8daa140 100644 --- a/tests/convert/result-detail/task.json +++ b/tests/convert/result-detail/task.json @@ -10,6 +10,92 @@ "sandboxToken": "", "outputPath": "/tmp/joj3_result.json", "stages": [ + { + "name": "Health Check", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-check-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--group-config", + "" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 1 + } + }, + { + "name": "debug", + "with": { + "score": 0 + } + } + ] + }, { "name": "[cq] Filelength", "group": "cq", @@ -86,6 +172,73 @@ } ], "preStages": [], - "postStages": [] + "postStages": [ + { + "name": "teapot", + "group": "", + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "Nuvole-joj", + "--max-total-score", + "100" + ], + "env": [ + "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" + ], + "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": {}, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" + } + } + ] + } + ] } }