Compare commits

..

4 Commits

Author SHA1 Message Date
adfdc027f2 fix: merge master
Some checks failed
build / build (pull_request) Failing after 2m34s
build / build (push) Failing after 2m32s
2025-02-27 14:37:40 +08:00
aee123601f
fix: root path for tests
All checks were successful
build / build (push) Successful in 2m23s
2025-02-27 01:28:43 -05:00
ae77fa23b5
fix: default path for tests 2025-02-27 01:26:21 -05:00
870f20dde9
chore: remove unused utils 2025-02-27 01:25:56 -05:00
3 changed files with 8 additions and 15 deletions

View File

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

View File

@ -11,15 +11,15 @@ from joj3_config_generator.models import repo, task
def read_convert_files(
case_name: str,
) -> Tuple[repo.Config, task.Config, Dict[str, Any]]:
root = Path(__file__).resolve().parent
repo_toml_path = root.absolute() / case_name / "repo.toml"
root = Path(__file__).resolve().parent / case_name
repo_toml_path = root / "repo.toml"
repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else ""
task_toml_path = root.absolute() / case_name / "task.toml"
task_toml_path = root / "task.toml"
task_toml = task_toml_path.read_text() if task_toml_path.exists() else ""
result = json.loads((root.absolute() / case_name / "task.json").read_text())
result = json.loads((root / "task.json").read_text())
return (
repo.Config(**rtoml.loads(repo_toml)),
task.Config(**rtoml.loads(task_toml)),
repo.Config(root=root, **rtoml.loads(repo_toml)),
task.Config(root=root, **rtoml.loads(task_toml)),
result,
)

View File

@ -1,7 +0,0 @@
from typing import Any
def safe_id(x: Any) -> str:
if not x or not isinstance(x, (tuple, list)) or len(x) == 0:
return "no_test_cases"
return str(x[0])