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
|
```bash
|
||||||
python tools/prompt_smoke.py --list
|
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 --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
|
The script does not import ComfyUI. It builds representative metadata rows and
|
||||||
pair metadata through the core Python APIs, then verifies:
|
pair metadata through the core Python APIs, then verifies:
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -106,11 +106,13 @@ SdxlTrigger = "mythp0rt"
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SmokeReport:
|
class SmokeReport:
|
||||||
|
verbose: bool = True
|
||||||
passed: list[str] = field(default_factory=list)
|
passed: list[str] = field(default_factory=list)
|
||||||
failed: list[str] = field(default_factory=list)
|
failed: list[str] = field(default_factory=list)
|
||||||
|
|
||||||
def ok(self, name: str) -> None:
|
def ok(self, name: str) -> None:
|
||||||
self.passed.append(name)
|
self.passed.append(name)
|
||||||
|
if self.verbose:
|
||||||
print(f"PASS {name}")
|
print(f"PASS {name}")
|
||||||
|
|
||||||
def fail(self, name: str, message: str) -> None:
|
def fail(self, name: str, message: str) -> None:
|
||||||
@@ -8924,13 +8926,18 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
action="append",
|
action="append",
|
||||||
help="Run only the named smoke case. Can be passed multiple times.",
|
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)
|
args = parser.parse_args(argv)
|
||||||
if args.list:
|
if args.list:
|
||||||
for name, _func in SMOKE_CASES:
|
for name, _func in SMOKE_CASES:
|
||||||
print(name)
|
print(name)
|
||||||
return 0
|
return 0
|
||||||
selected = set(args.case or [])
|
selected = set(args.case or [])
|
||||||
report = SmokeReport()
|
report = SmokeReport(verbose=not args.quiet)
|
||||||
for name, func in SMOKE_CASES:
|
for name, func in SMOKE_CASES:
|
||||||
if selected and name not in selected:
|
if selected and name not in selected:
|
||||||
continue
|
continue
|
||||||
@@ -8940,6 +8947,9 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
report.fail(name, str(exc))
|
report.fail(name, str(exc))
|
||||||
else:
|
else:
|
||||||
report.ok(name)
|
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")
|
print(f"\nSummary: {len(report.passed)} passed, {len(report.failed)} failed")
|
||||||
if report.failed:
|
if report.failed:
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user