Add real workspace acceptance

This commit is contained in:
2026-06-30 17:33:15 +08:00
parent 4eb9452760
commit 53b81dd04d
11 changed files with 418 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ import urllib.error
import urllib.request
from pathlib import Path
from ..acceptance import run_deep_acceptance, run_live_acceptance
from ..acceptance import run_deep_acceptance, run_live_acceptance, run_real_dataset_acceptance
from ..capabilities import get_capability_matrix
from ..catalog import get_catalog
from ..config import settings
@@ -42,7 +42,12 @@ def _fetch(url: str, timeout: int = 5) -> dict:
return {"url": url, "error": str(exc), "passed": False}
def validate_project(run_build: bool = False, run_acceptance: bool | None = None, run_deep: bool | None = None) -> dict:
def validate_project(
run_build: bool = False,
run_acceptance: bool | None = None,
run_deep: bool | None = None,
run_real: bool | None = None,
) -> dict:
"""Validate current runtime readiness without launching heavy training."""
checks = []
catalog = get_catalog()
@@ -143,9 +148,13 @@ def validate_project(run_build: bool = False, run_acceptance: bool | None = None
checks.append({"name": "live_frontend_index", "passed": frontend["passed"] and "Seg Data Server" in frontend.get("body", ""), "detail": frontend})
acceptance_enabled = run_acceptance if run_acceptance is not None else os.getenv("SEG_VALIDATE_ACCEPTANCE", "1") == "1"
deep_enabled = run_deep if run_deep is not None else os.getenv("SEG_VALIDATE_DEEP", "1") == "1"
real_enabled = run_real if run_real is not None else os.getenv("SEG_VALIDATE_REAL", "0") == "1"
if acceptance_enabled:
acceptance = run_live_acceptance(backend_url)
checks.append({"name": "live_acceptance_smoke", "passed": acceptance["passed"], "detail": acceptance})
if real_enabled:
real_acceptance = run_real_dataset_acceptance(backend_url)
checks.append({"name": "real_workspace_acceptance", "passed": real_acceptance["passed"], "detail": real_acceptance})
if deep_enabled:
deep_acceptance = run_deep_acceptance()
checks.append({"name": "deep_training_acceptance", "passed": deep_acceptance["passed"], "detail": deep_acceptance})