Add quiet smoke reporting

This commit is contained in:
2026-06-27 21:21:13 +02:00
parent a539055565
commit b6314a246a
2 changed files with 17 additions and 3 deletions
+4
View File
@@ -948,8 +948,12 @@ To inspect or run a focused path while editing one route:
```bash
python tools/prompt_smoke.py --list
python tools/prompt_smoke.py --case krea_format_route_policy --case sdxl_format_route_policy
python tools/prompt_smoke.py --quiet
```
Use `--quiet` when you only need pass/fail output for the selected cases or the
full suite.
The script does not import ComfyUI. It builds representative metadata rows and
pair metadata through the core Python APIs, then verifies:
+11 -1
View File
@@ -106,11 +106,13 @@ SdxlTrigger = "mythp0rt"
@dataclass
class SmokeReport:
verbose: bool = True
passed: list[str] = field(default_factory=list)
failed: list[str] = field(default_factory=list)
def ok(self, name: str) -> None:
self.passed.append(name)
if self.verbose:
print(f"PASS {name}")
def fail(self, name: str, message: str) -> None:
@@ -8924,13 +8926,18 @@ def main(argv: list[str] | None = None) -> int:
action="append",
help="Run only the named smoke case. Can be passed multiple times.",
)
parser.add_argument(
"--quiet",
action="store_true",
help="Suppress passing case lines and print one success summary.",
)
args = parser.parse_args(argv)
if args.list:
for name, _func in SMOKE_CASES:
print(name)
return 0
selected = set(args.case or [])
report = SmokeReport()
report = SmokeReport(verbose=not args.quiet)
for name, func in SMOKE_CASES:
if selected and name not in selected:
continue
@@ -8940,6 +8947,9 @@ def main(argv: list[str] | None = None) -> int:
report.fail(name, str(exc))
else:
report.ok(name)
if args.quiet and not report.failed:
print(f"OK: smoke passed ({len(report.passed)} cases).")
else:
print(f"\nSummary: {len(report.passed)} passed, {len(report.failed)} failed")
if report.failed:
return 1