feat: remove task.stage.skip

This commit is contained in:
张泊明518370910136 2025-06-29 14:28:11 -04:00
parent 6769e19d83
commit 6a7c5eb5f8
GPG Key ID: D47306D7062CDA9D
3 changed files with 26 additions and 26 deletions

View File

@ -7,6 +7,7 @@ from pydantic import AliasChoices, BaseModel, Field, model_validator
class Files(BaseModel): class Files(BaseModel):
required: List[str] = [] required: List[str] = []
# TODO: remove immutable in the future
immutable: List[str] = [] immutable: List[str] = []
@ -37,6 +38,21 @@ class Config(BaseModel):
root: Path = Field(Path("."), exclude=True) root: Path = Field(Path("."), exclude=True)
path: Path = Field(Path("repo.toml"), exclude=True) path: Path = Field(Path("repo.toml"), exclude=True)
force_skip_health_check_on_test: bool = Field(
False,
validation_alias=AliasChoices(
"force-skip-health-check-on-test", "force_skip_health_check_on_test"
),
exclude=True,
)
force_skip_teapot_on_test: bool = Field(
False,
validation_alias=AliasChoices(
"force-skip-teapot-on-test", "force_skip_teapot_on_test"
),
exclude=True,
)
max_size: float = Field( max_size: float = Field(
10, ge=0, validation_alias=AliasChoices("max-size", "max_size") 10, ge=0, validation_alias=AliasChoices("max-size", "max_size")
) )
@ -44,30 +60,10 @@ class Config(BaseModel):
sandbox_token: str = Field( sandbox_token: str = Field(
"", validation_alias=AliasChoices("sandbox-token", "sandbox_token") "", validation_alias=AliasChoices("sandbox-token", "sandbox_token")
) )
gitea_token: str = Field(
"", validation_alias=AliasChoices("gitea-token", "gitea_token")
)
gitea_org: str = Field("", validation_alias=AliasChoices("gitea-org", "gitea_org"))
max_total_score: int = Field( max_total_score: int = Field(
100, validation_alias=AliasChoices("max-total-score", "max_total_score") 100, validation_alias=AliasChoices("max-total-score", "max_total_score")
) )
force_skip_health_check_on_test: bool = Field(
False,
validation_alias=AliasChoices(
"force-skip-health-check-on-test", "force_skip_health_check_on_test"
),
)
force_skip_teapot_on_test: bool = Field(
False,
validation_alias=AliasChoices(
"force-skip-teapot-on-test", "force_skip_teapot_on_test"
),
)
groups: Groups = Groups() groups: Groups = Groups()
grading_repo_name: str = Field(
"",
validation_alias=AliasChoices("grading-repo-name", "grading_repo_name"),
)
health_check_score: int = Field( health_check_score: int = Field(
0, validation_alias=AliasChoices("health-check-score", "health_check_score") 0, validation_alias=AliasChoices("health-check-score", "health_check_score")
) )
@ -76,6 +72,15 @@ class Config(BaseModel):
Path("immutable"), Path("immutable"),
validation_alias=AliasChoices("immutable-path", "immutable_path"), validation_alias=AliasChoices("immutable-path", "immutable_path"),
) )
grading_repo_name: str = Field(
"",
validation_alias=AliasChoices("grading-repo-name", "grading_repo_name"),
)
# TODO: remove gitea_token and gitea_org in the future
gitea_token: str = Field(
"", validation_alias=AliasChoices("gitea-token", "gitea_token")
)
gitea_org: str = Field("", validation_alias=AliasChoices("gitea-org", "gitea_org"))
@model_validator(mode="after") @model_validator(mode="after")
def set_grading_repo_name_from_cwd(self) -> "Config": def set_grading_repo_name_from_cwd(self) -> "Config":

View File

@ -198,7 +198,6 @@ class Case(BaseModel):
class Stage(Case): class Stage(Case):
name: str = "" # stage name name: str = "" # stage name
skip: List[str] = []
parsers: List[Parser] = [] # list of parsers parsers: List[Parser] = [] # list of parsers
dummy: ParserDummy = ParserDummy() dummy: ParserDummy = ParserDummy()

View File

@ -193,11 +193,7 @@ def fix_diff(
# cases not specified in the toml config (auto-detected) # cases not specified in the toml config (auto-detected)
unspecified_cases = get_unspecified_cases(task_root, task_path, task_stage.cases) unspecified_cases = get_unspecified_cases(task_root, task_path, task_stage.cases)
# cases specified in toml config but not skipped # cases specified in toml config but not skipped
specified_cases = [ specified_cases = [(case, task_stage.cases[case]) for case in task_stage.cases]
(case, task_stage.cases[case])
for case in task_stage.cases
if case not in task_stage.skip
]
stage_cases = [] stage_cases = []
parser_cases = [] parser_cases = []
for case_name, case in specified_cases: for case_name, case in specified_cases: