test_governance_sync_bounded.py python
38 lines 1.3 KB
Raw
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago
1 """Performance tests for governance-sync (§8 performance tier)."""
2
3 from __future__ import annotations
4
5 import time
6 from pathlib import Path
7
8 from cli.kit_root import kit_root
9 from tests.support import FIXTURES, ok, make_runner, run_cli, write_config
10
11
12 def test_governance_sync_bounded_on_realistic_docs(tmp_path: Path) -> None:
13 write_config(tmp_path, "config-git-only.yaml")
14 docs = tmp_path / "docs"
15 docs.mkdir(parents=True, exist_ok=True)
16 kit_docs = Path(__file__).resolve().parents[2] / "docs"
17 (docs / "OVERSEER-HANDOVER.md").write_text(
18 (kit_docs / "OVERSEER-HANDOVER.md").read_text(encoding="utf-8"),
19 encoding="utf-8",
20 )
21 (docs / "ROADMAP.md").write_text(
22 (kit_docs / "ROADMAP.md").read_text(encoding="utf-8"),
23 encoding="utf-8",
24 )
25 runner = make_runner(
26 {
27 "git rev-parse --abbrev-ref HEAD": ok("main"),
28 "git status --porcelain": ok(""),
29 "git rev-parse origin/main": ok("cdd669f"),
30 "gh pr list": ok("[]"),
31 "git remote get-url origin": ok("[email protected]:owner/repo.git"),
32 }
33 )
34 start = time.perf_counter()
35 code = run_cli(["governance-sync"], cwd=tmp_path, runner=runner, kit=kit_root())
36 elapsed = time.perf_counter() - start
37 assert code in {0, 2}
38 assert elapsed < 2.0
File History 2 commits
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 1 day ago
sha256:4671b7f787ddbe63ced31c895b688c77ab495653b65a730b423329f26b3c1439 feat: K1-P1 complete — agent provenance, build-verification… Sonnet 4.6 patch 53 days ago