diff --git a/joj3_config_generator/generator.py b/joj3_config_generator/generator.py index ba5a0ab..171aad4 100644 --- a/joj3_config_generator/generator.py +++ b/joj3_config_generator/generator.py @@ -36,20 +36,18 @@ def convert_joj3_conf(repo_conf: repo.Config, task_conf: task.Config) -> result. if not task_conf.max_total_score else task_conf.max_total_score ), - stage=result.Stage(sandbox_token=repo_conf.sandbox_token), + sandbox_token=repo_conf.sandbox_token, ) current_test = os.environ.get("PYTEST_CURRENT_TEST") is not None # Construct health check stage if not repo_conf.force_skip_health_check_on_test or not current_test: - result_conf.stage.stages.append(get_health_check_stage(repo_conf, task_conf)) + result_conf.stages.append(get_health_check_stage(repo_conf, task_conf)) cached: Dict[str, None] = {} # Convert each stage in the task configuration for task_stage in task_conf.stages: - result_conf.stage.stages.append(get_conf_stage(task_conf, task_stage, cached)) + result_conf.stages.append(get_conf_stage(task_conf, task_stage, cached)) if not repo_conf.force_skip_teapot_on_test or not current_test: - result_conf.stage.post_stages.append( - get_teapot_post_stage(repo_conf, task_conf) - ) + result_conf.post_stages.append(get_teapot_post_stage(repo_conf, task_conf)) return result_conf diff --git a/joj3_config_generator/models/result.py b/joj3_config_generator/models/result.py index 9d1a886..3fd935d 100644 --- a/joj3_config_generator/models/result.py +++ b/joj3_config_generator/models/result.py @@ -151,7 +151,11 @@ class StageDetail(BaseModel): parsers: List[Parser] -class Stage(BaseModel): +class Config(BaseModel): + name: str = "" + log_path: str = Field("", serialization_alias="logPath") + actor_csv_path: str = Field("", serialization_alias="actorCsvPath") + max_total_score: int = Field(100, serialization_alias="maxTotalScore") sandbox_exec_server: str = Field( "172.17.0.1:5051", serialization_alias="sandboxExecServer" ) @@ -159,19 +163,11 @@ class Stage(BaseModel): output_path: str = Field( "/tmp/joj3_result.json", serialization_alias="outputPath" ) # nosec: B108 - stages: List[StageDetail] = [] pre_stages: List[StageDetail] = Field([], serialization_alias="preStages") + stages: List[StageDetail] = [] post_stages: List[StageDetail] = Field([], serialization_alias="postStages") -class Config(BaseModel): - name: str = "" - log_path: str = Field("", serialization_alias="logPath") - actor_csv_path: str = Field("", serialization_alias="actorCsvPath") - max_total_score: int = Field(100, serialization_alias="maxTotalScore") - stage: Stage - - class DummyConfig(BaseModel): score: int = 0 comment: Optional[str] = None diff --git a/tests/convert/basic/task.json b/tests/convert/basic/task.json index 87a509e..786b760 100644 --- a/tests/convert/basic/task.json +++ b/tests/convert/basic/task.json @@ -3,901 +3,82 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "actorCsvPath": "/home/tt/.config/joj/students.csv", "maxTotalScore": 10245871, - "stage": { - "sandboxExecServer": "172.17.0.1:5051", - "sandboxToken": "test", - "outputPath": "/tmp/joj3_result.json", - "stages": [ - { - "name": "Health Check", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { - "args": [], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 10000000000, - "clockLimit": 20000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "test", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "Health Check", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [ - { - "args": [ - "/usr/local/bin/repo-health-checker", - "-root=.", - "-repoSize=50.5", - "-meta=README.md", - "-meta=Changelog.md", - "-checkFileSumList=b1bbad25b830db0a77b15a033f9ca1b7ab44c1d2d05056412bd3e4421645f0bf,2ba059f3977e2e3dee6cacbfbf0ba2578baa1b8e04b4977aec400868b6e49856,3db23f7fb2ca9814617e767ddc41b77073180b3b0b73e87b5f2a6d3129f88f3a,a5b63323a692d3d8b952442969649b4f823d58dae26429494f613df160710dfc", - "-checkFileNameList=.gitattributes,.gitea/workflows/push.yaml,.gitea/workflows/release.yaml,.gitignore" - ] - }, - { - "args": [ - "/usr/local/bin/joint-teapot", - "joj3-check-env", - "/home/tt/.config/teapot/teapot.env", - "--grading-repo-name", - "ece280-joj", - "--scoreboard-filename", - "scoreboard-hw7.csv", - "--group-config", - "Manuel=500:24,Boming=501:48,Nuvole=502:72", - "--begin-time", - "2024-12-29T23:59:59", - "--end-time", - "2024-12-30T23:59:59", - "--penalty-config", - "24.0=0.5,48.0=0.25,72.0=0.1" - ], - "env": [ - "REPOS_DIR=/home/tt/.cache", - "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" - ] - } - ] - } - }, - "parsers": [ - { - "name": "healthcheck", - "with": { - "score": 0 - } + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 10000000000, + "clockLimit": 20000000000, + "memoryLimit": 268435456, + "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 }, - { - "name": "debug", - "with": {} - } - ] - }, - { - "name": "Compilation", - "groups": [], - "executor": { - "name": "sandbox", - "with": { - "default": { + "cases": [ + { "args": [ - "./tools/compile" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin", - "CC=clang", - "CXX=clang++" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tools/compile": { - "src": "/home/tt/.config/joj/tools/compile" - }, - "h7/Makefile": { - "src": "/home/tt/.config/joj/tools/Makefile" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [ - "h7/build/ex2", - "h7/build/ex2-asan", - "h7/build/ex2-ubsan", - "h7/build/ex2-msan", - "h7/build/compile_commands.json" - ], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, - "cases": [] - } - }, - "parsers": [ - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - }, - { - "name": "result-status", - "with": { - "score": 0, - "comment": "Congratulations! Your code compiled successfully.", - "forceQuitOnNotAccepted": true - } - } - ] - }, - { - "name": "[cq] Filelength", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "./tools/filelength", - "400", - "300", - "*.cpp", - "*.h" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tools/filelength": { - "src": "/home/tt/.config/joj/tools/filelength" - } - }, - "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-asan": "h7/build/ex2-asan", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" - }, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, - "cases": [] - } - }, - "parsers": [ - { - "name": "keyword", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "max" - ], - "score": 20 - }, - { - "keywords": [ - "recommended" - ], - "score": 10 - } + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=50.5", + "-meta=README.md", + "-meta=Changelog.md", + "-checkFileSumList=b1bbad25b830db0a77b15a033f9ca1b7ab44c1d2d05056412bd3e4421645f0bf,2ba059f3977e2e3dee6cacbfbf0ba2578baa1b8e04b4977aec400868b6e49856,3db23f7fb2ca9814617e767ddc41b77073180b3b0b73e87b5f2a6d3129f88f3a,a5b63323a692d3d8b952442969649b4f823d58dae26429494f613df160710dfc", + "-checkFileNameList=.gitattributes,.gitea/workflows/push.yaml,.gitea/workflows/release.yaml,.gitignore" ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stdout" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - }, - { - "name": "[cq] Clang-tidy", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "run-clang-tidy-18", - "-header-filter=.*", - "-quiet", - "-load=/usr/local/lib/libcodequality.so", - "-p", - "h7/build", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 4194304, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tests/homework/h7/.clang-tidy": { - "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" - } - }, - "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-asan": "h7/build/ex2-asan", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" - }, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false }, - "cases": [] - } - }, - "parsers": [ - { - "name": "clangtidy", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "codequality-unchecked-malloc-result", - "readability-duplicate-include", - "readability-identifier-naming", - "readability-redundant", - "readability-misplaced-array-index", - "cppcoreguidelines-init-variables", - "bugprone-suspicious-string-compare", - "google-global-names-in-headers", - "clang-diagnostic", - "clang-analyzer", - "misc", - "performance", - "portability" - ], - "score": 5 - }, - { - "keywords": [ - "codequality-no-global-variables", - "codequality-no-header-guard", - "codequality-no-fflush-stdin" - ], - "score": 20 - }, - { - "keywords": [ - "readability-function-size" - ], - "score": 10 - }, - { - "keywords": [ - "readability-misleading-indentation" - ], - "score": 15 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stdout" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - }, - { - "name": "[cq] Cppcheck", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "cppcheck", - "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}", - "--force", - "--enable=all", - "--suppress=missingIncludeSystem", - "--quiet", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 8388608, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": {}, - "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-asan": "h7/build/ex2-asan", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" - }, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, - "cases": [] - } - }, - "parsers": [ - { - "name": "keyword", - "with": { - "score": 0, - "matches": [] - } - }, - { - "name": "cppcheck", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "error" - ], - "score": 15 - }, - { - "keywords": [ - "warning", - "portability", - "performance", - "style" - ], - "score": 5 - } - ] - } - }, - { - "name": "clangtidy", - "with": { - "score": 0, - "matches": [] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - }, - { - "name": "cpplint", - "with": { - "score": 0, - "matches": [] - } - }, - { - "name": "result-status", - "with": { - "score": 0, - "comment": "", - "forceQuitOnNotAccepted": true - } - }, - { - "name": "file", - "with": { - "name": "" - } - }, - { - "name": "dummy", - "with": { - "score": 0, - "comment": "", - "forceQuit": false - } - }, - { - "name": "diff", - "with": { - "name": "diff", - "cases": [] - } - } - ] - }, - { - "name": "[cq] Cpplint", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "cpplint", - "--linelength=120", - "--filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-runtime/int,-readability/todo,-build/include_subdir,-build/header_guard,-build/include_what_you_use", - "--recursive", - "--exclude=build", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 68157440, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": {}, - "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-asan": "h7/build/ex2-asan", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" - }, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, - "cases": [] - } - }, - "parsers": [ - { - "name": "cpplint", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "runtime" - ], - "score": 5 - }, - { - "keywords": [ - "readability" - ], - "score": 20 - }, - { - "keywords": [ - "build" - ], - "score": 10 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - }, - { - "name": "[joj] ex2-asan", - "groups": [ - "joj" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "./h7/build/ex2-asan", - "-a" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 100000000000, - "memoryLimit": 134217728, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": {}, - "copyInCached": { - "h7/build/ex2": "h7/build/ex2", - "h7/build/ex2-asan": "h7/build/ex2-asan", - "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", - "h7/build/ex2-msan": "h7/build/ex2-msan", - "h7/build/compile_commands.json": "h7/build/compile_commands.json" - }, - "copyInDir": "", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, - "cases": [ - { - "stdin": { - "content": "" - }, - "cpuLimit": 500000000, - "clockLimit": 1000000000, - "memoryLimit": 5242880 - }, - { - "stdin": { - "content": "" - }, - "memoryLimit": 5242880 - }, - { - "stdin": { - "content": "" - } - } - ] - } - }, - "parsers": [ - { - "name": "diff", - "with": { - "name": "diff", - "cases": [ - { - "outputs": [ - { - "score": 10, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/basic/cases/case0.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/basic/cases/case1.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 10, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/basic/cases/case2.out", - "compareSpace": false, - "alwaysHide": true, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - } - ], - "preStages": [], - "postStages": [ - { - "name": "teapot", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { + { "args": [ "/usr/local/bin/joint-teapot", - "joj3-all-env", + "joj3-check-env", "/home/tt/.config/teapot/teapot.env", "--grading-repo-name", "ece280-joj", - "--max-total-score", - "10245871", - "--issue-label-name", - "Kind/Testing", - "--issue-label-color", - "#795548", "--scoreboard-filename", "scoreboard-hw7.csv", + "--group-config", + "Manuel=500:24,Boming=501:48,Nuvole=502:72", + "--begin-time", + "2024-12-29T23:59:59", "--end-time", "2024-12-30T23:59:59", "--penalty-config", @@ -906,58 +87,875 @@ "env": [ "REPOS_DIR=/home/tt/.cache", "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" - ], + ] + } + ] + } + }, + "parsers": [ + { + "name": "healthcheck", + "with": { + "score": 0 + } + }, + { + "name": "debug", + "with": {} + } + ] + }, + { + "name": "Compilation", + "groups": [], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/compile" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin", + "CC=clang", + "CXX=clang++" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tools/compile": { + "src": "/home/tt/.config/joj/tools/compile" + }, + "h7/Makefile": { + "src": "/home/tt/.config/joj/tools/Makefile" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [ + "h7/build/ex2", + "h7/build/ex2-asan", + "h7/build/ex2-ubsan", + "h7/build/ex2-msan", + "h7/build/compile_commands.json" + ], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + }, + { + "name": "result-status", + "with": { + "score": 0, + "comment": "Congratulations! Your code compiled successfully.", + "forceQuitOnNotAccepted": true + } + } + ] + }, + { + "name": "[cq] Filelength", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/filelength", + "400", + "300", + "*.cpp", + "*.h" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tools/filelength": { + "src": "/home/tt/.config/joj/tools/filelength" + } + }, + "copyInCached": { + "h7/build/ex2": "h7/build/ex2", + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2-msan": "h7/build/ex2-msan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json" + }, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "keyword", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "max" + ], + "score": 20 + }, + { + "keywords": [ + "recommended" + ], + "score": 10 + } + ] + } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stdout" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + } + ] + }, + { + "name": "[cq] Clang-tidy", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "run-clang-tidy-18", + "-header-filter=.*", + "-quiet", + "-load=/usr/local/lib/libcodequality.so", + "-p", + "h7/build", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 4194304, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tests/homework/h7/.clang-tidy": { + "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" + } + }, + "copyInCached": { + "h7/build/ex2": "h7/build/ex2", + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2-msan": "h7/build/ex2-msan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json" + }, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "clangtidy", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "codequality-unchecked-malloc-result", + "readability-duplicate-include", + "readability-identifier-naming", + "readability-redundant", + "readability-misplaced-array-index", + "cppcoreguidelines-init-variables", + "bugprone-suspicious-string-compare", + "google-global-names-in-headers", + "clang-diagnostic", + "clang-analyzer", + "misc", + "performance", + "portability" + ], + "score": 5 + }, + { + "keywords": [ + "codequality-no-global-variables", + "codequality-no-header-guard", + "codequality-no-fflush-stdin" + ], + "score": 20 + }, + { + "keywords": [ + "readability-function-size" + ], + "score": 10 + }, + { + "keywords": [ + "readability-misleading-indentation" + ], + "score": 15 + } + ] + } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stdout" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + } + ] + }, + { + "name": "[cq] Cppcheck", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "cppcheck", + "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}", + "--force", + "--enable=all", + "--suppress=missingIncludeSystem", + "--quiet", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 8388608, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": { + "h7/build/ex2": "h7/build/ex2", + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2-msan": "h7/build/ex2-msan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json" + }, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "keyword", + "with": { + "score": 0, + "matches": [] + } + }, + { + "name": "cppcheck", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "error" + ], + "score": 15 + }, + { + "keywords": [ + "warning", + "portability", + "performance", + "style" + ], + "score": 5 + } + ] + } + }, + { + "name": "clangtidy", + "with": { + "score": 0, + "matches": [] + } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + }, + { + "name": "cpplint", + "with": { + "score": 0, + "matches": [] + } + }, + { + "name": "result-status", + "with": { + "score": 0, + "comment": "", + "forceQuitOnNotAccepted": true + } + }, + { + "name": "file", + "with": { + "name": "" + } + }, + { + "name": "dummy", + "with": { + "score": 0, + "comment": "", + "forceQuit": false + } + }, + { + "name": "diff", + "with": { + "name": "diff", + "cases": [] + } + } + ] + }, + { + "name": "[cq] Cpplint", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "cpplint", + "--linelength=120", + "--filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-runtime/int,-readability/todo,-build/include_subdir,-build/header_guard,-build/include_what_you_use", + "--recursive", + "--exclude=build", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 68157440, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": { + "h7/build/ex2": "h7/build/ex2", + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2-msan": "h7/build/ex2-msan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json" + }, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "cpplint", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "runtime" + ], + "score": 5 + }, + { + "keywords": [ + "readability" + ], + "score": 20 + }, + { + "keywords": [ + "build" + ], + "score": 10 + } + ] + } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + } + ] + }, + { + "name": "[joj] ex2-asan", + "groups": [ + "joj" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./h7/build/ex2-asan", + "-a" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 100000000000, + "memoryLimit": 134217728, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": {}, + "copyInCached": { + "h7/build/ex2": "h7/build/ex2", + "h7/build/ex2-asan": "h7/build/ex2-asan", + "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", + "h7/build/ex2-msan": "h7/build/ex2-msan", + "h7/build/compile_commands.json": "h7/build/compile_commands.json" + }, + "copyInDir": "", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { "stdin": { "content": "" }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 30000000000, - "clockLimit": 60000000000, - "memoryLimit": 268435456, - "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 + "cpuLimit": 500000000, + "clockLimit": 1000000000, + "memoryLimit": 5242880 }, - "cases": [] + { + "stdin": { + "content": "" + }, + "memoryLimit": 5242880 + }, + { + "stdin": { + "content": "" + } + } + ] + } + }, + "parsers": [ + { + "name": "diff", + "with": { + "name": "diff", + "cases": [ + { + "outputs": [ + { + "score": 10, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/basic/cases/case0.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/basic/cases/case1.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 10, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/basic/cases/case2.out", + "compareSpace": false, + "alwaysHide": true, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + } + ] } }, - "parsers": [ - { - "name": "log", - "with": { - "msg": "joj3 summary" - } - }, - { - "name": "debug", - "with": {} + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ] - } + } + ] + } + ], + "postStages": [ + { + "name": "teapot", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "ece280-joj", + "--max-total-score", + "10245871", + "--issue-label-name", + "Kind/Testing", + "--issue-label-color", + "#795548", + "--scoreboard-filename", + "scoreboard-hw7.csv", + "--end-time", + "2024-12-30T23:59:59", + "--penalty-config", + "24.0=0.5,48.0=0.25,72.0=0.1" + ], + "env": [ + "REPOS_DIR=/home/tt/.cache", + "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": 30000000000, + "clockLimit": 60000000000, + "memoryLimit": 268435456, + "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" + } + }, + { + "name": "debug", + "with": {} + } + ] + } + ] } diff --git a/tests/convert/clang-tidy/task.json b/tests/convert/clang-tidy/task.json index e7bac27..47ed5ec 100644 --- a/tests/convert/clang-tidy/task.json +++ b/tests/convert/clang-tidy/task.json @@ -3,147 +3,145 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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] Clang-tidy", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "run-clang-tidy-18", - "-header-filter=.*", - "-quiet", - "-load=/usr/local/lib/libcodequality.so", - "-p", - "h7/build", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 68157440, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tests/homework/h7/.clang-tidy": { - "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" - }, - "h7/build/compile_commands.json": { - "src": "/home/tt/.config/joj/h7/build/compile_commands.json" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Clang-tidy", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "run-clang-tidy-18", + "-header-filter=.*", + "-quiet", + "-load=/usr/local/lib/libcodequality.so", + "-p", + "h7/build", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 68157440, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tests/homework/h7/.clang-tidy": { + "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" + }, + "h7/build/compile_commands.json": { + "src": "/home/tt/.config/joj/h7/build/compile_commands.json" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "clangtidy", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "codequality-unchecked-malloc-result", + "readability-duplicate-include", + "readability-identifier-naming", + "readability-redundant", + "readability-misplaced-array-index", + "cppcoreguidelines-init-variables", + "bugprone-suspicious-string-compare", + "google-global-names-in-headers", + "clang-diagnostic", + "clang-analyzer", + "misc", + "performance", + "portability" + ], + "score": 5 + }, + { + "keywords": [ + "codequality-no-global-variables", + "codequality-no-header-guard", + "codequality-no-fflush-stdin" + ], + "score": 20 + }, + { + "keywords": [ + "readability-function-size" + ], + "score": 10 + }, + { + "keywords": [ + "readability-misleading-indentation" + ], + "score": 15 + } + ] } }, - "parsers": [ - { - "name": "clangtidy", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "codequality-unchecked-malloc-result", - "readability-duplicate-include", - "readability-identifier-naming", - "readability-redundant", - "readability-misplaced-array-index", - "cppcoreguidelines-init-variables", - "bugprone-suspicious-string-compare", - "google-global-names-in-headers", - "clang-diagnostic", - "clang-analyzer", - "misc", - "performance", - "portability" - ], - "score": 5 - }, - { - "keywords": [ - "codequality-no-global-variables", - "codequality-no-header-guard", - "codequality-no-fflush-stdin" - ], - "score": 20 - }, - { - "keywords": [ - "readability-function-size" - ], - "score": 10 - }, - { - "keywords": [ - "readability-misleading-indentation" - ], - "score": 15 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stdout" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stdout" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/cppcheck/task.json b/tests/convert/cppcheck/task.json index 5c6936f..39ccdfd 100644 --- a/tests/convert/cppcheck/task.json +++ b/tests/convert/cppcheck/task.json @@ -3,117 +3,115 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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] Cppcheck", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "cppcheck", - "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}", - "--force", - "--enable=all", - "--suppress=missingIncludeSystem", - "--quiet", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 68157440, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Cppcheck", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "cppcheck", + "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}", + "--force", + "--enable=all", + "--suppress=missingIncludeSystem", + "--quiet", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 68157440, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "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": "cppcheck", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "error" + ], + "score": 15 + }, + { + "keywords": [ + "warning", + "portability", + "performance", + "style" + ], + "score": 5 + } + ] } }, - "parsers": [ - { - "name": "cppcheck", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "error" - ], - "score": 15 - }, - { - "keywords": [ - "warning", - "portability", - "performance", - "style" - ], - "score": 5 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/cpplint/task.json b/tests/convert/cpplint/task.json index 403c1ae..43e6330 100644 --- a/tests/convert/cpplint/task.json +++ b/tests/convert/cpplint/task.json @@ -3,119 +3,117 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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] Cpplint", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "cpplint", - "--linelength=120", - "--filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-runtime/int,-readability/todo,-build/include_subdir,-build/header_guard,-build/include_what_you_use", - "--recursive", - "--exclude=build", - "h7/ex2.cpp" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 68157440, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Cpplint", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "cpplint", + "--linelength=120", + "--filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-runtime/int,-readability/todo,-build/include_subdir,-build/header_guard,-build/include_what_you_use", + "--recursive", + "--exclude=build", + "h7/ex2.cpp" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 68157440, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "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": "cpplint", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "runtime" + ], + "score": 5 + }, + { + "keywords": [ + "readability" + ], + "score": 20 + }, + { + "keywords": [ + "build" + ], + "score": 10 + } + ] } }, - "parsers": [ - { - "name": "cpplint", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "runtime" - ], - "score": 5 - }, - { - "keywords": [ - "readability" - ], - "score": 20 - }, - { - "keywords": [ - "build" - ], - "score": 10 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/diff/task.json b/tests/convert/diff/task.json index bb37c18..002964f 100644 --- a/tests/convert/diff/task.json +++ b/tests/convert/diff/task.json @@ -3,692 +3,690 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "actorCsvPath": "/home/tt/.config/joj/students.csv", "maxTotalScore": 100, - "stage": { - "sandboxExecServer": "172.17.0.1:5051", - "sandboxToken": "", - "outputPath": "/tmp/joj3_result.json", - "stages": [ - { - "name": "[joj] ex2-asan", - "groups": [ - "joj" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[joj] ex2-asan", + "groups": [ + "joj" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./h7/build/ex2-asan", + "-a" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 10485760, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 10485760, + "pipe": true + }, + "cpuLimit": 3000000000, + "clockLimit": 6000000000, + "memoryLimit": 10485760, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "h7/build/ex2-asan": { + "src": "/home/tt/.config/joj/h7/build/ex2-asan" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { "args": [ - "./h7/build/ex2-asan", - "-a" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" + "./h7/build/ex2" ], "stdin": { - "content": "" + "src": "/home/tt/.config/joj/diff/case0.in" }, - "stdout": { - "name": "stdout", - "max": 10485760, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 10485760, - "pipe": true - }, - "cpuLimit": 3000000000, - "clockLimit": 6000000000, - "memoryLimit": 10485760, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "h7/build/ex2-asan": { - "src": "/home/tt/.config/joj/h7/build/ex2-asan" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 2097152 }, - "cases": [ - { - "args": [ - "./h7/build/ex2" - ], - "stdin": { - "src": "/home/tt/.config/joj/diff/case0.in" - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 2097152 - }, - { - "args": [ - "./h7/build/ex2" - ], - "stdin": { - "src": "/home/tt/.config/joj/diff/case1.in" - }, - "cpuLimit": 2000000000, - "clockLimit": 4000000000, - "memoryLimit": 4194304 - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/case9.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/subtask1/case11.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/subtask1/case10.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/case5.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/case2.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/case4.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case6.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case7.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case8.in" - } - } - ] - } - }, - "parsers": [ - { - "name": "diff", - "with": { - "name": "diff", - "cases": [ - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/case0.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 123214122421, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/case1.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 1232131, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/case9.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 92321, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case11.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 823131, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case10.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 2590, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/case5.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/case2.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/case4.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case6.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case7.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case8.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [ - "stderr" + { + "args": [ + "./h7/build/ex2" ], - "filesInCodeBlock": true, - "maxFileLength": 2048 + "stdin": { + "src": "/home/tt/.config/joj/diff/case1.in" + }, + "cpuLimit": 2000000000, + "clockLimit": 4000000000, + "memoryLimit": 4194304 + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/case9.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/case11.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/case10.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/case5.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/case2.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/case4.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case6.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case7.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case8.in" + } } - } - ] + ] + } }, - { - "name": "[joj] ex2-asan base dir task1", - "groups": [ - "joj" - ], - "executor": { - "name": "sandbox", + "parsers": [ + { + "name": "diff", "with": { - "default": { - "args": [ - "./h7/build/ex2-asan", - "-a" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 10485760, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 10485760, - "pipe": true - }, - "cpuLimit": 3000000000, - "clockLimit": 6000000000, - "memoryLimit": 10485760, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "h7/build/ex2-asan": { - "src": "/home/tt/.config/joj/h7/build/ex2-asan" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, + "name": "diff", "cases": [ { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/case5.in" - } + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case0.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/case9.in" - } + "outputs": [ + { + "score": 123214122421, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case1.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/case4.in" - } + "outputs": [ + { + "score": 1232131, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case9.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/subtask1/case10.in" - } + "outputs": [ + { + "score": 92321, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case11.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task1/subtask1/case11.in" - } + "outputs": [ + { + "score": 823131, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case10.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 2590, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/case5.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/case2.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/case4.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case6.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case7.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case8.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] } ] } }, - "parsers": [ - { - "name": "diff", - "with": { - "name": "diff", - "cases": [ - { - "outputs": [ - { - "score": 2590, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/case5.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 99999, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/case9.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/case4.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case10.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case11.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] + } + ] + }, + { + "name": "[joj] ex2-asan base dir task1", + "groups": [ + "joj" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./h7/build/ex2-asan", + "-a" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 10485760, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 10485760, + "pipe": true + }, + "cpuLimit": 3000000000, + "clockLimit": 6000000000, + "memoryLimit": 10485760, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "h7/build/ex2-asan": { + "src": "/home/tt/.config/joj/h7/build/ex2-asan" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/case5.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/case9.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/case4.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/case10.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task1/subtask1/case11.in" + } + } + ] + } }, - { - "name": "[joj] ex2-asan base dir task2", - "groups": [ - "joj" - ], - "executor": { - "name": "sandbox", + "parsers": [ + { + "name": "diff", "with": { - "default": { - "args": [ - "./h7/build/ex2-asan", - "-a" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 10485760, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 10485760, - "pipe": true - }, - "cpuLimit": 3000000000, - "clockLimit": 6000000000, - "memoryLimit": 10485760, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "h7/build/ex2-asan": { - "src": "/home/tt/.config/joj/h7/build/ex2-asan" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false - }, + "name": "diff", "cases": [ { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case9.in" - } + "outputs": [ + { + "score": 2590, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/case5.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case6.in" - } + "outputs": [ + { + "score": 99999, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/case9.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case7.in" - } + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/case4.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] }, { - "stdin": { - "src": "/home/tt/.config/joj/diff/task2/case8.in" - } + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case10.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task1/subtask1/case11.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] } ] } }, - "parsers": [ - { - "name": "diff", - "with": { - "name": "diff", - "cases": [ - { - "outputs": [ - { - "score": 99999, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case9.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case6.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case7.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 100, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/diff/task2/case8.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [ - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + }, + { + "name": "[joj] ex2-asan base dir task2", + "groups": [ + "joj" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./h7/build/ex2-asan", + "-a" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 10485760, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 10485760, + "pipe": true + }, + "cpuLimit": 3000000000, + "clockLimit": 6000000000, + "memoryLimit": 10485760, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "h7/build/ex2-asan": { + "src": "/home/tt/.config/joj/h7/build/ex2-asan" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [ + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case9.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case6.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case7.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/diff/task2/case8.in" + } + } + ] + } + }, + "parsers": [ + { + "name": "diff", + "with": { + "name": "diff", + "cases": [ + { + "outputs": [ + { + "score": 99999, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case9.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case6.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case7.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 100, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/diff/task2/case8.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + } + ] + } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [ + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/elf/task.json b/tests/convert/elf/task.json index 7f3f15b..99a8703 100644 --- a/tests/convert/elf/task.json +++ b/tests/convert/elf/task.json @@ -3,127 +3,125 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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] elf", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "elf", - "./", - "--md" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 68157440, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tests/homework/h7/.clang-tidy": { - "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" - }, - "h7/build/compile_commands.json": { - "src": "/home/tt/.config/joj/h7/build/compile_commands.json" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] elf", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "elf", + "./", + "--md" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 68157440, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tests/homework/h7/.clang-tidy": { + "src": "/home/tt/.config/joj/tests/homework/h7/.clang-tidy" + }, + "h7/build/compile_commands.json": { + "src": "/home/tt/.config/joj/h7/build/compile_commands.json" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false + }, + "cases": [] + } + }, + "parsers": [ + { + "name": "elf", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "Parentheses" + ], + "score": 100 + }, + { + "keywords": [ + "Length" + ], + "score": 300 + }, + { + "keywords": [ + "Arity" + ], + "score": 50 + }, + { + "keywords": [ + "Repetitive" + ], + "score": 80 + } + ] } }, - "parsers": [ - { - "name": "elf", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "Parentheses" - ], - "score": 100 - }, - { - "keywords": [ - "Length" - ], - "score": 300 - }, - { - "keywords": [ - "Arity" - ], - "score": 50 - }, - { - "keywords": [ - "Repetitive" - ], - "score": 80 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/empty/task.json b/tests/convert/empty/task.json index 7c4ab96..37e1579 100644 --- a/tests/convert/empty/task.json +++ b/tests/convert/empty/task.json @@ -3,178 +3,176 @@ "logPath": "/home/tt/.cache/joj3/health/joj3.log", "actorCsvPath": "/home/tt/.config/joj/students.csv", "maxTotalScore": 100, - "stage": { - "sandboxExecServer": "172.17.0.1:5051", - "sandboxToken": "", - "outputPath": "/tmp/joj3_result.json", - "stages": [ - { - "name": "Health Check", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { - "args": [], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 10000000000, - "clockLimit": 20000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "Health Check", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [ - { - "args": [ - "/usr/local/bin/repo-health-checker", - "-root=.", - "-repoSize=10.0", - "-checkFileSumList=", - "-checkFileNameList=" - ] - }, - { - "args": [ - "/usr/local/bin/joint-teapot", - "joj3-check-env", - "/home/tt/.config/teapot/teapot.env", - "--grading-repo-name", - "JOJ3-config-generator", - "--scoreboard-filename", - "scoreboard.csv" - ], - "env": [ - "REPOS_DIR=/home/tt/.cache", - "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" - ] - } - ] - } - }, - "parsers": [ - { - "name": "healthcheck", - "with": { - "score": 0 - } + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 10000000000, + "clockLimit": 20000000000, + "memoryLimit": 268435456, + "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 }, - { - "name": "debug", - "with": {} - } - ] - } - ], - "preStages": [], - "postStages": [ - { - "name": "teapot", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { + "cases": [ + { + "args": [ + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10.0", + "-checkFileSumList=", + "-checkFileNameList=" + ] + }, + { "args": [ "/usr/local/bin/joint-teapot", - "joj3-all-env", + "joj3-check-env", "/home/tt/.config/teapot/teapot.env", "--grading-repo-name", "JOJ3-config-generator", - "--max-total-score", - "0", - "--issue-label-name", - "Kind/Testing", - "--issue-label-color", - "#795548", "--scoreboard-filename", "scoreboard.csv" ], "env": [ "REPOS_DIR=/home/tt/.cache", "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": 30000000000, - "clockLimit": 60000000000, - "memoryLimit": 268435456, - "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": "healthcheck", + "with": { + "score": 0 } }, - "parsers": [ - { - "name": "log", - "with": { - "msg": "joj3 summary" - } + { + "name": "debug", + "with": {} + } + ] + } + ], + "postStages": [ + { + "name": "teapot", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "JOJ3-config-generator", + "--max-total-score", + "0", + "--issue-label-name", + "Kind/Testing", + "--issue-label-color", + "#795548", + "--scoreboard-filename", + "scoreboard.csv" + ], + "env": [ + "REPOS_DIR=/home/tt/.cache", + "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": 30000000000, + "clockLimit": 60000000000, + "memoryLimit": 268435456, + "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 }, - { - "name": "debug", - "with": {} + "cases": [] + } + }, + "parsers": [ + { + "name": "log", + "with": { + "msg": "joj3 summary" } - ] - } - ] - } + }, + { + "name": "debug", + "with": {} + } + ] + } + ] } diff --git a/tests/convert/full/task.json b/tests/convert/full/task.json index a2928bd..51924a9 100644 --- a/tests/convert/full/task.json +++ b/tests/convert/full/task.json @@ -3,451 +3,82 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "actorCsvPath": "/home/tt/.config/joj/students.csv", "maxTotalScore": 100, - "stage": { - "sandboxExecServer": "172.17.0.1:5051", - "sandboxToken": "", - "outputPath": "/tmp/joj3_result.json", - "stages": [ - { - "name": "Health Check", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { - "args": [], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 10000000000, - "clockLimit": 20000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "Health Check", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [ - { - "args": [ - "/usr/local/bin/repo-health-checker", - "-root=.", - "-repoSize=10.0", - "-meta=README.md", - "-meta=Changelog.md", - "-checkFileSumList=b1bbad25b830db0a77b15a033f9ca1b7ab44c1d2d05056412bd3e4421645f0bf,2ba059f3977e2e3dee6cacbfbf0ba2578baa1b8e04b4977aec400868b6e49856,3db23f7fb2ca9814617e767ddc41b77073180b3b0b73e87b5f2a6d3129f88f3a,a5b63323a692d3d8b952442969649b4f823d58dae26429494f613df160710dfc", - "-checkFileNameList=.gitattributes,.gitea/workflows/push.yaml,.gitea/workflows/release.yaml,.gitignore" - ] - }, - { - "args": [ - "/usr/local/bin/joint-teapot", - "joj3-check-env", - "/home/tt/.config/teapot/teapot.env", - "--grading-repo-name", - "JOJ3-config-generator", - "--scoreboard-filename", - "scoreboard-hw7.csv", - "--group-config", - "joj=1000:24,run=100:1", - "--begin-time", - "2024-12-29T23:59:59", - "--end-time", - "2024-12-30T23:59:59", - "--penalty-config", - "24.0=0.75,48.0=0.5,72.0=0.25" - ], - "env": [ - "REPOS_DIR=/home/tt/.cache", - "LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log" - ] - } - ] - } - }, - "parsers": [ - { - "name": "healthcheck", - "with": { - "score": 0 - } + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 10000000000, + "clockLimit": 20000000000, + "memoryLimit": 268435456, + "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 }, - { - "name": "debug", - "with": {} - } - ] - }, - { - "name": "Generate yes.txt [no]", - "groups": [ - "run", - "no" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { + "cases": [ + { "args": [ - "sh", - "-c", - "yes | head -n 10 > yes.txt" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin", - "THE_ANSWER=42" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "stackLimit": 0, - "procLimit": 50, - "cpuRateLimit": 0, - "cpuSetLimit": "", - "copyIn": { - "tools/filelength": { - "src": "/home/tt/.config/joj/tools/filelength" - }, - "h7/Makefile": { - "src": "/home/tt/.config/joj/tools/Makefile" - } - }, - "copyInCached": {}, - "copyInDir": ".", - "copyOut": [ - "stdout", - "stderr" - ], - "copyOutCached": [ - "yes.txt" - ], - "copyOutMax": 0, - "copyOutDir": "", - "tty": false, - "strictMemoryLimit": false, - "dataSegmentLimit": false, - "addressSpaceLimit": false + "/usr/local/bin/repo-health-checker", + "-root=.", + "-repoSize=10.0", + "-meta=README.md", + "-meta=Changelog.md", + "-checkFileSumList=b1bbad25b830db0a77b15a033f9ca1b7ab44c1d2d05056412bd3e4421645f0bf,2ba059f3977e2e3dee6cacbfbf0ba2578baa1b8e04b4977aec400868b6e49856,3db23f7fb2ca9814617e767ddc41b77073180b3b0b73e87b5f2a6d3129f88f3a,a5b63323a692d3d8b952442969649b4f823d58dae26429494f613df160710dfc", + "-checkFileNameList=.gitattributes,.gitea/workflows/push.yaml,.gitea/workflows/release.yaml,.gitignore" + ] }, - "cases": [ - { - "stdin": { - "src": "/home/tt/.config/joj/full/cases/case0.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/full/cases/case2.in" - }, - "cpuLimit": 2000000000, - "memoryLimit": 536870912 - }, - { - "stdin": { - "src": "/home/tt/.config/joj/full/cases/case1.in" - } - }, - { - "stdin": { - "src": "/home/tt/.config/joj/full/other/cases/case3.in" - } - } - ] - } - }, - "parsers": [ - { - "name": "result-status", - "with": { - "score": 0, - "comment": "Congrats! There is a yes.txt file generated!", - "forceQuitOnNotAccepted": true - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - }, - { - "name": "keyword", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "aaa" - ], - "score": 20 - }, - { - "keywords": [ - "bbb" - ], - "score": 10 - }, - { - "keywords": [ - "ccc" - ], - "score": 5 - } - ] - } - }, - { - "name": "clangtidy", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "clang-diagnostic", - "clang-analyzer", - "misc", - "performance", - "portability" - ], - "score": 5 - } - ] - } - }, - { - "name": "cppcheck", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "error" - ], - "score": 15 - }, - { - "keywords": [ - "warning", - "portability", - "performance", - "style" - ], - "score": 5 - } - ] - } - }, - { - "name": "cpplint", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "runtime" - ], - "score": 5 - }, - { - "keywords": [ - "readability" - ], - "score": 20 - }, - { - "keywords": [ - "build" - ], - "score": 10 - } - ] - } - }, - { - "name": "elf", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "Parentheses" - ], - "score": 100 - }, - { - "keywords": [ - "Length" - ], - "score": 300 - }, - { - "keywords": [ - "Arity" - ], - "score": 50 - }, - { - "keywords": [ - "Repetitive" - ], - "score": 80 - } - ] - } - }, - { - "name": "dummy", - "with": { - "score": 0, - "comment": "", - "forceQuit": false - } - }, - { - "name": "diff", - "with": { - "name": "diff", - "cases": [ - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/full/cases/case0.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/full/cases/case2.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/full/cases/case1.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - }, - { - "outputs": [ - { - "score": 5, - "filename": "stdout", - "answerPath": "/home/tt/.config/joj/full/other/cases/case3.out", - "compareSpace": false, - "alwaysHide": false, - "forceQuitOnDiff": false, - "maxDiffLength": 2048, - "maxDiffLines": 50, - "hideCommonPrefix": false - } - ] - } - ] - } - } - ] - } - ], - "preStages": [], - "postStages": [ - { - "name": "teapot", - "groups": [], - "executor": { - "name": "local", - "with": { - "default": { + { "args": [ "/usr/local/bin/joint-teapot", - "joj3-all-env", + "joj3-check-env", "/home/tt/.config/teapot/teapot.env", "--grading-repo-name", "JOJ3-config-generator", - "--max-total-score", - "100", - "--issue-label-name", - "Kind/Testing", - "--issue-label-color", - "#795548", "--scoreboard-filename", "scoreboard-hw7.csv", - "--scoreboard-column-by-ref", + "--group-config", + "joj=1000:24,run=100:1", + "--begin-time", + "2024-12-29T23:59:59", "--end-time", "2024-12-30T23:59:59", "--penalty-config", @@ -456,58 +87,425 @@ "env": [ "REPOS_DIR=/home/tt/.cache", "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": 30000000000, - "clockLimit": 60000000000, - "memoryLimit": 268435456, - "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": "healthcheck", + "with": { + "score": 0 } }, - "parsers": [ - { - "name": "log", - "with": { - "msg": "joj3 summary" - } + { + "name": "debug", + "with": {} + } + ] + }, + { + "name": "Generate yes.txt [no]", + "groups": [ + "run", + "no" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "sh", + "-c", + "yes | head -n 10 > yes.txt" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin", + "THE_ANSWER=42" + ], + "stdin": { + "content": "" + }, + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "stackLimit": 0, + "procLimit": 50, + "cpuRateLimit": 0, + "cpuSetLimit": "", + "copyIn": { + "tools/filelength": { + "src": "/home/tt/.config/joj/tools/filelength" + }, + "h7/Makefile": { + "src": "/home/tt/.config/joj/tools/Makefile" + } + }, + "copyInCached": {}, + "copyInDir": ".", + "copyOut": [ + "stdout", + "stderr" + ], + "copyOutCached": [ + "yes.txt" + ], + "copyOutMax": 0, + "copyOutDir": "", + "tty": false, + "strictMemoryLimit": false, + "dataSegmentLimit": false, + "addressSpaceLimit": false }, - { - "name": "debug", - "with": {} + "cases": [ + { + "stdin": { + "src": "/home/tt/.config/joj/full/cases/case0.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/full/cases/case2.in" + }, + "cpuLimit": 2000000000, + "memoryLimit": 536870912 + }, + { + "stdin": { + "src": "/home/tt/.config/joj/full/cases/case1.in" + } + }, + { + "stdin": { + "src": "/home/tt/.config/joj/full/other/cases/case3.in" + } + } + ] + } + }, + "parsers": [ + { + "name": "result-status", + "with": { + "score": 0, + "comment": "Congrats! There is a yes.txt file generated!", + "forceQuitOnNotAccepted": true } - ] - } - ] - } + }, + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [], + "filesInCodeBlock": true, + "maxFileLength": 2048 + } + }, + { + "name": "keyword", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "aaa" + ], + "score": 20 + }, + { + "keywords": [ + "bbb" + ], + "score": 10 + }, + { + "keywords": [ + "ccc" + ], + "score": 5 + } + ] + } + }, + { + "name": "clangtidy", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "clang-diagnostic", + "clang-analyzer", + "misc", + "performance", + "portability" + ], + "score": 5 + } + ] + } + }, + { + "name": "cppcheck", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "error" + ], + "score": 15 + }, + { + "keywords": [ + "warning", + "portability", + "performance", + "style" + ], + "score": 5 + } + ] + } + }, + { + "name": "cpplint", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "runtime" + ], + "score": 5 + }, + { + "keywords": [ + "readability" + ], + "score": 20 + }, + { + "keywords": [ + "build" + ], + "score": 10 + } + ] + } + }, + { + "name": "elf", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "Parentheses" + ], + "score": 100 + }, + { + "keywords": [ + "Length" + ], + "score": 300 + }, + { + "keywords": [ + "Arity" + ], + "score": 50 + }, + { + "keywords": [ + "Repetitive" + ], + "score": 80 + } + ] + } + }, + { + "name": "dummy", + "with": { + "score": 0, + "comment": "", + "forceQuit": false + } + }, + { + "name": "diff", + "with": { + "name": "diff", + "cases": [ + { + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/full/cases/case0.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/full/cases/case2.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/full/cases/case1.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + }, + { + "outputs": [ + { + "score": 5, + "filename": "stdout", + "answerPath": "/home/tt/.config/joj/full/other/cases/case3.out", + "compareSpace": false, + "alwaysHide": false, + "forceQuitOnDiff": false, + "maxDiffLength": 2048, + "maxDiffLines": 50, + "hideCommonPrefix": false + } + ] + } + ] + } + } + ] + } + ], + "postStages": [ + { + "name": "teapot", + "groups": [], + "executor": { + "name": "local", + "with": { + "default": { + "args": [ + "/usr/local/bin/joint-teapot", + "joj3-all-env", + "/home/tt/.config/teapot/teapot.env", + "--grading-repo-name", + "JOJ3-config-generator", + "--max-total-score", + "100", + "--issue-label-name", + "Kind/Testing", + "--issue-label-color", + "#795548", + "--scoreboard-filename", + "scoreboard-hw7.csv", + "--scoreboard-column-by-ref", + "--end-time", + "2024-12-30T23:59:59", + "--penalty-config", + "24.0=0.75,48.0=0.5,72.0=0.25" + ], + "env": [ + "REPOS_DIR=/home/tt/.cache", + "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": 30000000000, + "clockLimit": 60000000000, + "memoryLimit": 268435456, + "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" + } + }, + { + "name": "debug", + "with": {} + } + ] + } + ] } diff --git a/tests/convert/keyword/task.json b/tests/convert/keyword/task.json index aba53b5..9c3010f 100644 --- a/tests/convert/keyword/task.json +++ b/tests/convert/keyword/task.json @@ -3,116 +3,114 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "./tools/filelength", - "400", - "300", - "*.cpp", - "*.h" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Filelength", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/filelength", + "400", + "300", + "*.cpp", + "*.h" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "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": "keyword", + "with": { + "score": 0, + "matches": [ + { + "keywords": [ + "max" + ], + "score": 20 + }, + { + "keywords": [ + "recommended" + ], + "score": 10 + } + ] } }, - "parsers": [ - { - "name": "keyword", - "with": { - "score": 0, - "matches": [ - { - "keywords": [ - "max" - ], - "score": 20 - }, - { - "keywords": [ - "recommended" - ], - "score": 10 - } - ] - } - }, - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stdout" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } + { + "name": "result-detail", + "with": { + "score": 0, + "comment": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stdout" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/result-detail/task.json b/tests/convert/result-detail/task.json index c00ba50..3fc1922 100644 --- a/tests/convert/result-detail/task.json +++ b/tests/convert/result-detail/task.json @@ -3,97 +3,95 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "./tools/filelength", - "400", - "300", - "*.cpp", - "*.h" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Filelength", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/filelength", + "400", + "300", + "*.cpp", + "*.h" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "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": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": false, + "showRuntime": false, + "showProcPeak": false, + "showFiles": [ + "stdout", + "stderr" + ], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - }, - "parsers": [ - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": false, - "showRuntime": false, - "showProcPeak": false, - "showFiles": [ - "stdout", - "stderr" - ], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] } diff --git a/tests/convert/unnecessary/task.json b/tests/convert/unnecessary/task.json index 892281a..60ac655 100644 --- a/tests/convert/unnecessary/task.json +++ b/tests/convert/unnecessary/task.json @@ -3,94 +3,92 @@ "logPath": "/home/tt/.cache/joj3/hw7/joj3.log", "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", - "groups": [ - "cq" - ], - "executor": { - "name": "sandbox", - "with": { - "default": { - "args": [ - "./tools/filelength", - "400", - "300", - "*.cpp", - "*.h" - ], - "env": [ - "PATH=/usr/bin:/bin:/usr/local/bin" - ], - "stdin": { - "content": "" - }, - "stdout": { - "name": "stdout", - "max": 33554432, - "pipe": true - }, - "stderr": { - "name": "stderr", - "max": 33554432, - "pipe": true - }, - "cpuLimit": 1000000000, - "clockLimit": 2000000000, - "memoryLimit": 268435456, - "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 + "sandboxExecServer": "172.17.0.1:5051", + "sandboxToken": "", + "outputPath": "/tmp/joj3_result.json", + "preStages": [], + "stages": [ + { + "name": "[cq] Filelength", + "groups": [ + "cq" + ], + "executor": { + "name": "sandbox", + "with": { + "default": { + "args": [ + "./tools/filelength", + "400", + "300", + "*.cpp", + "*.h" + ], + "env": [ + "PATH=/usr/bin:/bin:/usr/local/bin" + ], + "stdin": { + "content": "" }, - "cases": [] + "stdout": { + "name": "stdout", + "max": 33554432, + "pipe": true + }, + "stderr": { + "name": "stderr", + "max": 33554432, + "pipe": true + }, + "cpuLimit": 1000000000, + "clockLimit": 2000000000, + "memoryLimit": 268435456, + "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": "", + "showExxecutorStatus": true, + "showExitStatus": true, + "showError": false, + "showTime": true, + "showMemory": true, + "showRuntime": true, + "showProcPeak": false, + "showFiles": [], + "filesInCodeBlock": true, + "maxFileLength": 2048 } - }, - "parsers": [ - { - "name": "result-detail", - "with": { - "score": 0, - "comment": "", - "showExxecutorStatus": true, - "showExitStatus": true, - "showError": false, - "showTime": true, - "showMemory": true, - "showRuntime": true, - "showProcPeak": false, - "showFiles": [], - "filesInCodeBlock": true, - "maxFileLength": 2048 - } - } - ] - } - ], - "preStages": [], - "postStages": [] - } + } + ] + } + ], + "postStages": [] }