From d451fed83201fc00cb1782e0c212219aa10f347d Mon Sep 17 00:00:00 2001 From: Nuvole Date: Sat, 9 Nov 2024 10:45:40 +0800 Subject: [PATCH] feat: remove tmp directory --- joj3_config_generator/convert.py | 2 +- joj3_config_generator/lib/repo.py | 8 +- tests/convert_joj1/basic/task.toml | 118 +++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+), 6 deletions(-) diff --git a/joj3_config_generator/convert.py b/joj3_config_generator/convert.py index 4fbda28..b20807e 100644 --- a/joj3_config_generator/convert.py +++ b/joj3_config_generator/convert.py @@ -37,7 +37,7 @@ def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config: ) # Construct healthcheck stage - healthcheck_stage = getHealthcheckConfig(repo_conf, task_conf) + healthcheck_stage = getHealthcheckConfig(repo_conf) result_conf.stage.stages.append(healthcheck_stage) cached: list[str] = [] # Convert each stage in the task configuration diff --git a/joj3_config_generator/lib/repo.py b/joj3_config_generator/lib/repo.py index 3f1935a..ffba830 100644 --- a/joj3_config_generator/lib/repo.py +++ b/joj3_config_generator/lib/repo.py @@ -36,7 +36,7 @@ def getHealthcheckCmd(repo_conf: repo.Config) -> result.Cmd: else: immutable_files = immutable_files + name + "," # FIXME: need to make solution and make things easier to edit with global scope - chore = f"/tmp/repo-health-checker -root=. " + chore = f"./repo-health-checker -root=. " args = "" args = args + chore args = args + repo_size @@ -51,15 +51,13 @@ def getHealthcheckCmd(repo_conf: repo.Config) -> result.Cmd: args=args.split(), # FIXME: easier to edit within global scope copy_in={ - f"/tmp/repo-health-checker": result.CmdFile(src=f"/tmp/repo-health-checker") + f"./repo-health-checker": result.CmdFile(src=f"./repo-health-checker") }, ) return cmd -def getHealthcheckConfig( - repo_conf: repo.Config, task_conf: task.Config -) -> result.StageDetail: +def getHealthcheckConfig(repo_conf: repo.Config) -> result.StageDetail: healthcheck_stage = result.StageDetail( name="healthcheck", group="", diff --git a/tests/convert_joj1/basic/task.toml b/tests/convert_joj1/basic/task.toml index e69de29..a58cd74 100644 --- a/tests/convert_joj1/basic/task.toml +++ b/tests/convert_joj1/basic/task.toml @@ -0,0 +1,118 @@ +task = "cc" + +[[stages]] +name = "cc" +command = "run cc" +score = 100 +parsers = [] +skip = [] + +[stages.files] +import = [] +export = [] + +[stages.limit] +mem = 4 +cpu = 4 +stderr = 4 +stdout = 4 + +[stages.dummy] +comment = "" +score = 0 +forcequit = true + +[stages.result-status] +comment = "" +score = 0 +forcequit = true + +[stages.keyword] +keyword = [] +weight = [] + +[stages.clangtidy] +keyword = [] +weight = [] + +[stages.cppcheck] +keyword = [] +weight = [] + +[stages.cpplint] +keyword = [] +weight = [] + +[stages.result-detail] +time = true +mem = true +stdout = false +stderr = false +exitstatus = false +[stages.diff.output] +score = 0 +ignorespaces = false +hide = false +forcequit = true + +[stages.cases] + +[[stages]] +name = "c" +command = "run c" +score = 100 +parsers = [] +skip = [] + +[stages.files] +import = [] +export = [] + +[stages.limit] +mem = 4 +cpu = 4 +stderr = 4 +stdout = 4 + +[stages.dummy] +comment = "" +score = 0 +forcequit = true + +[stages.result-status] +comment = "" +score = 0 +forcequit = true + +[stages.keyword] +keyword = [] +weight = [] + +[stages.clangtidy] +keyword = [] +weight = [] + +[stages.cppcheck] +keyword = [] +weight = [] + +[stages.cpplint] +keyword = [] +weight = [] + +[stages.result-detail] +time = true +mem = true +stdout = false +stderr = false +exitstatus = false +[stages.diff.output] +score = 0 +ignorespaces = false +hide = false +forcequit = true + +[stages.cases] + +[release] +deadline = "null"