test_gfg_d2_bridge_parse.py file-level

at sha256:a · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:6 fix(ISR): default require_independent_second_reviewer to require Opera… · aaronrene · Sep 2, 2026
1 """Performance: bridge parse is file-local, no network (§D2F.9 performance)."""
2
3 from __future__ import annotations
4
5 import time
6 from pathlib import Path
7
8 from adapters.base import read_bridge_git_sha, read_bridge_muse_commit_id
9
10
11 def test_bridge_parse_bounded_and_local(tmp_path: Path) -> None:
12 tip = "sha256:" + ("f" * 64)
13 git_sha = "e" * 40
14 muse = tmp_path / ".muse"
15 muse.mkdir()
16 (muse / "git-bridge.toml").write_text(
17 f'[last_export]\nmuse_commit_id = "{tip}"\ngit_sha = "{git_sha}"\n',
18 encoding="utf-8",
19 )
20 start = time.perf_counter()
21 for _ in range(200):
22 assert read_bridge_muse_commit_id(tmp_path, "last_export") == tip
23 assert read_bridge_git_sha(tmp_path, "last_export") == git_sha
24 assert time.perf_counter() - start < 1.0