diff options
| author | alexandersato0830 <66799221+alexandersato0830@users.noreply.github.com> | 2026-11-25 10:46:20 -0600 |
|---|---|---|
| committer | alexandersato0830 <66799221+alexandersato0830@users.noreply.github.com> | 2026-11-25 10:46:20 -0600 |
| commit | ab3eb20e6d7663a004aaf953861afefb76cb38d6 (patch) | |
| tree | 37a1cee233d8b1d3f262d6d5477b6deed068b9f8 /scripts | |
| parent | 9e7720c9e764211e0021aa23907d2d3ecd58963f (diff) | |
Reserve synthetic guest scene output before writing reports
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/run_guest_scene.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/run_guest_scene.py b/scripts/run_guest_scene.py index 60d5ded90..55f770c8b 100644 --- a/scripts/run_guest_scene.py +++ b/scripts/run_guest_scene.py | |||
| @@ -256,12 +256,13 @@ def negative_controls(session: Session, out: Path) -> dict: | |||
| 256 | 256 | ||
| 257 | 257 | ||
| 258 | def execute(args: argparse.Namespace, out: Path, temporary: bool) -> int: | 258 | def execute(args: argparse.Namespace, out: Path, temporary: bool) -> int: |
| 259 | session = Session(args, out) | ||
| 259 | try: | 260 | try: |
| 260 | out.mkdir(parents=True, exist_ok=True) # parse_args has checked that it is new or empty | 261 | out.mkdir(parents=True, exist_ok=True) # parse_args has checked that it is new or empty |
| 262 | session.logs.mkdir() # Reserve the output even if another run passed the same check. | ||
| 261 | except OSError as exc: | 263 | except OSError as exc: |
| 262 | print(f"error: could not create output directory {out}: {exc}", file=sys.stderr) | 264 | print(f"error: could not create output directory {out}: {exc}", file=sys.stderr) |
| 263 | return 1 | 265 | return 1 |
| 264 | session = Session(args, out) | ||
| 265 | report: dict = {"status": "fail", "frames": FRAMES, "headless": True, "wine": args.wine, "temporary": temporary, | 266 | report: dict = {"status": "fail", "frames": FRAMES, "headless": True, "wine": args.wine, "temporary": temporary, |
| 266 | "audio_mode": "winmm" if args.play_audio else "offline", "report": str(out / "report.json")} | 267 | "audio_mode": "winmm" if args.play_audio else "offline", "report": str(out / "report.json")} |
| 267 | try: | 268 | try: |
| @@ -271,7 +272,7 @@ def execute(args: argparse.Namespace, out: Path, temporary: bool) -> int: | |||
| 271 | "guest": {"path": str(args.guest), "sha256": sha256(args.guest.read_bytes())}, | 272 | "guest": {"path": str(args.guest), "sha256": sha256(args.guest.read_bytes())}, |
| 272 | "shaders": {"path": str(args.shaders), "files": len(shader_files), "tree_sha256": tree_hash(shader_files)}, | 273 | "shaders": {"path": str(args.shaders), "files": len(shader_files), "tree_sha256": tree_hash(shader_files)}, |
| 273 | "scene.bin": sha256(scene_bytes())} | 274 | "scene.bin": sha256(scene_bytes())} |
| 274 | for sub in ("logs", "package", *MODES): | 275 | for sub in ("package", *MODES): |
| 275 | (out / sub).mkdir() | 276 | (out / sub).mkdir() |
| 276 | package = out / "package" | 277 | package = out / "package" |
| 277 | write_new(package / "scene.bin", scene_bytes()) | 278 | write_new(package / "scene.bin", scene_bytes()) |