fix: pass pytest
All checks were successful
build / build (push) Successful in 2m29s
build / build (pull_request) Successful in 2m27s

This commit is contained in:
李衍志523370910113 2025-02-27 15:31:08 +08:00
parent adfdc027f2
commit 1f0ee639dd
9 changed files with 6 additions and 531 deletions

View File

@ -41,7 +41,7 @@ def convert_joj1(yaml_file: typer.FileText, toml_file: typer.FileTextWrite) -> N
joj1_obj = yaml.safe_load(yaml_file.read())
joj1_model = joj1.Config(**joj1_obj)
task_model = convert_joj1_conf(joj1_model)
result_dict = task_model.model_dump(by_alias=True)
result_dict = task_model.model_dump(by_alias=True, exclude_none=True)
toml_file.write(rtoml.dumps(result_dict))

View File

@ -108,8 +108,8 @@ class Task(BaseModel):
class Config(BaseModel):
root: Path = Path(".")
path: Path = Path("task.toml")
root: Optional[Path] = None
path: Optional[Path] = None
task: Task # Task name (e.g., hw3 ex5)
release: Release # Release configuration
stages: List[Stage] # list of stage configurations

View File

@ -122,7 +122,7 @@ def calc_sha256sum(file_path: Path) -> str:
def get_hash(
immutable_files: list[str], repo_conf: repo.Config
) -> str: # input should be a list
repo_path = repo_conf.path.parent
repo_path = (repo_conf.root / repo_conf.path).parent
file_path = Path(f"{repo_path}/immutable_files")
immutable_hash = []
immutable_files_ = []

View File

@ -10,111 +10,6 @@
"sandboxToken": "",
"outputPath": "/tmp/joj3_result.json",
"stages": [
{
"name": "healthcheck",
"group": "",
"executor": {
"name": "local",
"with": {
"default": {
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"stdin": {
"content": "",
"max": 419430400
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"cpuLimit": 4000000000000,
"realCpuLimit": 0,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"stackLimit": 0,
"procLimit": 50,
"cpuRateLimit": 0,
"cpuSetLimit": "",
"copyIn": {},
"copyInCached": {},
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [],
"copyOutMax": 0,
"copyOutDir": "",
"tty": false,
"strictMemoryLimit": false,
"dataSegmentLimit": false,
"addressSpaceLimit": false
},
"cases": [
{
"args": [
"/usr/local/bin/repo-health-checker",
"-root=.",
"-repoSize=10",
"-checkFileSumList=-checkFileNameList="
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
},
{
"args": [
"/usr/local/bin/joint-teapot",
"joj3-check-env",
"/home/tt/.config/teapot/teapot.env",
"--grading-repo-name",
"ece280-joj",
"--group-config",
"=100:24"
],
"env": [
"LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
}
]
}
},
"parsers": [
{
"name": "healthcheck",
"with": {
"score": 1
}
},
{
"name": "debug",
"with": {
"score": 0
}
}
]
},
{
"name": "[cq] Clang-tidy",
"group": "cq",

View File

@ -10,111 +10,6 @@
"sandboxToken": "",
"outputPath": "/tmp/joj3_result.json",
"stages": [
{
"name": "healthcheck",
"group": "",
"executor": {
"name": "local",
"with": {
"default": {
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"stdin": {
"content": "",
"max": 419430400
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"cpuLimit": 4000000000000,
"realCpuLimit": 0,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"stackLimit": 0,
"procLimit": 50,
"cpuRateLimit": 0,
"cpuSetLimit": "",
"copyIn": {},
"copyInCached": {},
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [],
"copyOutMax": 0,
"copyOutDir": "",
"tty": false,
"strictMemoryLimit": false,
"dataSegmentLimit": false,
"addressSpaceLimit": false
},
"cases": [
{
"args": [
"/usr/local/bin/repo-health-checker",
"-root=.",
"-repoSize=10",
"-checkFileSumList=-checkFileNameList="
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
},
{
"args": [
"/usr/local/bin/joint-teapot",
"joj3-check-env",
"/home/tt/.config/teapot/teapot.env",
"--grading-repo-name",
"ece280-joj",
"--group-config",
"=100:24"
],
"env": [
"LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
}
]
}
},
"parsers": [
{
"name": "healthcheck",
"with": {
"score": 1
}
},
{
"name": "debug",
"with": {
"score": 0
}
}
]
},
{
"name": "[cq] Cppcheck",
"group": "cq",

View File

@ -10,111 +10,6 @@
"sandboxToken": "",
"outputPath": "/tmp/joj3_result.json",
"stages": [
{
"name": "healthcheck",
"group": "",
"executor": {
"name": "local",
"with": {
"default": {
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"stdin": {
"content": "",
"max": 419430400
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"cpuLimit": 4000000000000,
"realCpuLimit": 0,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"stackLimit": 0,
"procLimit": 50,
"cpuRateLimit": 0,
"cpuSetLimit": "",
"copyIn": {},
"copyInCached": {},
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [],
"copyOutMax": 0,
"copyOutDir": "",
"tty": false,
"strictMemoryLimit": false,
"dataSegmentLimit": false,
"addressSpaceLimit": false
},
"cases": [
{
"args": [
"/usr/local/bin/repo-health-checker",
"-root=.",
"-repoSize=10",
"-checkFileSumList=-checkFileNameList="
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
},
{
"args": [
"/usr/local/bin/joint-teapot",
"joj3-check-env",
"/home/tt/.config/teapot/teapot.env",
"--grading-repo-name",
"ece280-joj",
"--group-config",
"=100:24"
],
"env": [
"LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
}
]
}
},
"parsers": [
{
"name": "healthcheck",
"with": {
"score": 1
}
},
{
"name": "debug",
"with": {
"score": 0
}
}
]
},
{
"name": "[cq] Cpplint",
"group": "cq",

View File

@ -10,111 +10,6 @@
"sandboxToken": "",
"outputPath": "/tmp/joj3_result.json",
"stages": [
{
"name": "healthcheck",
"group": "",
"executor": {
"name": "local",
"with": {
"default": {
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"stdin": {
"content": "",
"max": 419430400
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"cpuLimit": 4000000000000,
"realCpuLimit": 0,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"stackLimit": 0,
"procLimit": 50,
"cpuRateLimit": 0,
"cpuSetLimit": "",
"copyIn": {},
"copyInCached": {},
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [],
"copyOutMax": 0,
"copyOutDir": "",
"tty": false,
"strictMemoryLimit": false,
"dataSegmentLimit": false,
"addressSpaceLimit": false
},
"cases": [
{
"args": [
"/usr/local/bin/repo-health-checker",
"-root=.",
"-repoSize=10",
"-checkFileSumList=-checkFileNameList="
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
},
{
"args": [
"/usr/local/bin/joint-teapot",
"joj3-check-env",
"/home/tt/.config/teapot/teapot.env",
"--grading-repo-name",
"ece280-joj",
"--group-config",
"=100:24"
],
"env": [
"LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
}
]
}
},
"parsers": [
{
"name": "healthcheck",
"with": {
"score": 1
}
},
{
"name": "debug",
"with": {
"score": 0
}
}
]
},
{
"name": "[joj] ex2-asan",
"group": "joj",

View File

@ -10,111 +10,6 @@
"sandboxToken": "",
"outputPath": "/tmp/joj3_result.json",
"stages": [
{
"name": "healthcheck",
"group": "",
"executor": {
"name": "local",
"with": {
"default": {
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"stdin": {
"content": "",
"max": 419430400
},
"stdout": {
"name": "stdout",
"max": 4096
},
"stderr": {
"name": "stderr",
"max": 4096
},
"cpuLimit": 4000000000000,
"realCpuLimit": 0,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"stackLimit": 0,
"procLimit": 50,
"cpuRateLimit": 0,
"cpuSetLimit": "",
"copyIn": {},
"copyInCached": {},
"copyInDir": ".",
"copyOut": [
"stdout",
"stderr"
],
"copyOutCached": [],
"copyOutMax": 0,
"copyOutDir": "",
"tty": false,
"strictMemoryLimit": false,
"dataSegmentLimit": false,
"addressSpaceLimit": false
},
"cases": [
{
"args": [
"/usr/local/bin/repo-health-checker",
"-root=.",
"-repoSize=10",
"-checkFileSumList=-checkFileNameList="
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
},
{
"args": [
"/usr/local/bin/joint-teapot",
"joj3-check-env",
"/home/tt/.config/teapot/teapot.env",
"--grading-repo-name",
"ece280-joj",
"--group-config",
"=100:24"
],
"env": [
"LOG_FILE_PATH=/home/tt/.cache/joint-teapot-debug.log"
],
"cpuLimit": 4000000000000,
"clockLimit": 8000000000000,
"memoryLimit": 838860800,
"procLimit": 50,
"copyOut": [
"stdout",
"stderr"
]
}
]
}
},
"parsers": [
{
"name": "healthcheck",
"with": {
"score": 1
}
},
{
"name": "debug",
"with": {
"score": 0
}
}
]
},
{
"name": "[cq] Filelength",
"group": "cq",

View File

@ -18,6 +18,6 @@ def read_convert_joj1_files(case_name: str) -> Tuple[joj1.Config, Dict[str, Any]
def load_case(case_name: str) -> None:
joj1, expected_result = read_convert_joj1_files(case_name)
result = convert_joj1(joj1).model_dump(by_alias=True, exclude_none=True)
joj1_, expected_result = read_convert_joj1_files(case_name)
result = convert_joj1(joj1_).model_dump(by_alias=True, exclude_none=True)
assert result == expected_result