Add quiet smoke reporting
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
+13
-3
@@ -106,12 +106,14 @@ 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)
|
||||
print(f"PASS {name}")
|
||||
if self.verbose:
|
||||
print(f"PASS {name}")
|
||||
|
||||
def fail(self, name: str, message: str) -> None:
|
||||
detail = f"{name}: {message}"
|
||||
@@ -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,7 +8947,10 @@ def main(argv: list[str] | None = None) -> int:
|
||||
report.fail(name, str(exc))
|
||||
else:
|
||||
report.ok(name)
|
||||
print(f"\nSummary: {len(report.passed)} passed, {len(report.failed)} failed")
|
||||
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
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user