Files
taxbaik/scripts/verify_evidence_manifest.py
T
kjh2064 227ed21c1c
TaxBaik CI/CD / build-and-deploy (push) Successful in 3m15s
Verify Playwright evidence artifacts
2026-07-07 16:33:23 +09:00

38 lines
1.1 KiB
Python

from __future__ import annotations
import json
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
EVIDENCE_ROOT = Path(sys.argv[1]) if len(sys.argv) > 1 else ROOT / "evidence"
MANIFEST = EVIDENCE_ROOT / "manifest.jsonl"
def main() -> int:
print(f"evidence_root: {EVIDENCE_ROOT}")
if not MANIFEST.exists():
print(f"ERROR: manifest missing: {MANIFEST}")
return 1
lines = [line for line in MANIFEST.read_text(encoding="utf-8").splitlines() if line.strip()]
print(f"manifest_entries: {len(lines)}")
if not lines:
print("ERROR: manifest is empty")
return 1
for idx, line in enumerate(lines[:5], start=1):
record = json.loads(line)
for key in ("screenshotPath", "domPath", "urlPath"):
path = Path(record[key])
if not path.exists():
print(f"ERROR: missing {key} for entry {idx}: {path}")
return 1
print(f"OK: entry {idx} -> {record['label']}")
return 0
if __name__ == "__main__":
raise SystemExit(main())