Files
workinf_Blender_Wasm/tools/web/run-wbv2-smoke-closure.py
mes123456 f3e21c6b98
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-10 11:18:01 +08:00

60 lines
2.2 KiB
Python

#!/usr/bin/env python3
"""Supply local batch fixtures, run all configurations, and publish the outcome."""
import hashlib
import json
import os
from pathlib import Path
import signal
import subprocess
import sys
ROOT = Path(__file__).resolve().parents[2]
BASE = ROOT / "tests/golden/WBV2-P1424-001"
def execute(command, env=None):
process = subprocess.Popen(command, cwd=ROOT, env=env)
try:
return process.wait()
finally:
if process.poll() is None:
process.terminate()
try:
process.wait(timeout=15)
except subprocess.TimeoutExpired:
process.kill()
process.wait()
def interrupted(signum, _frame):
raise KeyboardInterrupt(f"Received signal {signum}")
def main():
batch_path = ROOT / "tests/golden/WBV2-P1152-001/modifier-reader-batch-production.json"
batch = json.loads(batch_path.read_text())
for name in batch["fixtures"]:
path = ROOT / name
if hashlib.sha256(path.read_bytes()).hexdigest() != batch["fixtureSha256"][name]:
raise RuntimeError(f"Local batch fixture changed: {name}")
env = {**{key: value for key, value in os.environ.items() if not key.startswith("WBV2_BATCH_")},
"WBV2_MODIFIER_BATCH_FIXTURES": json.dumps(batch["fixtures"]),
"WBV2_MODIFIER_BATCH_TYPES": json.dumps(batch["expectedTypes"]),
"WBV2_MODIFIER_BATCH_UNITS": json.dumps(batch["sourceUnits"]),
"WBV2_MODIFIER_BATCH_TASK": "WBV2-P1424-001",
"WBV2_MODIFIER_BATCH_PRODUCTION": "tests/golden/WBV2-P1424-001/full-smoke-modifier-batch-production.json"}
latest = BASE / "full-smoke-latest.json"
previous = latest.read_bytes() if latest.exists() else None
code = execute([sys.executable, str(ROOT / "tools/web/run-wbv2-full-smoke.py"), *sys.argv[1:]], env)
if not latest.exists() or latest.read_bytes() == previous:
return code or 1
pointer = json.loads(latest.read_text())
report = ROOT / pointer["report"]["path"]
recorded = execute([sys.executable, str(ROOT / "tools/web/record-wbv2-full-smoke.py"), str(report.parent)])
return recorded or code
if __name__ == "__main__":
signal.signal(signal.SIGTERM, interrupted)
raise SystemExit(main())