test_land_closeout_performance.py python
46 lines 1.4 KB
Raw
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14 Reconcile reviewed credential compatibility 32254cd939885d9… Human patch 8 days ago
1 """Performance: default status path adds no gh invocation for land closeout
2 (§PMHF.10 performance)."""
3
4 from __future__ import annotations
5
6 import time
7 from pathlib import Path
8
9 from tests.support import git_status_runner, land_a_fence_body, land_handover_text, run_cli, seed_land_repo
10
11
12 def test_default_status_path_never_invokes_gh(tmp_path: Path, capsys) -> None:
13 # Even when the paste names a PR, status (probe_merged_pr=False) must not call gh.
14 seed_land_repo(
15 tmp_path,
16 handover_text=land_handover_text(
17 "cafebabe",
18 fence_body=land_a_fence_body(paste_extra="PR #206 open — waiting for merge.\n"),
19 ),
20 )
21 runner = git_status_runner(tip="cafebabe")
22 code = run_cli(
23 ["status", "--json", "--exit-code"],
24 cwd=tmp_path,
25 runner=runner,
26 json_mode=True,
27 )
28 capsys.readouterr()
29 assert code == 0
30 assert not any(call[0].startswith("gh") for call in runner.calls)
31
32
33 def test_status_with_land_closeout_stays_bounded(tmp_path: Path, capsys) -> None:
34 seed_land_repo(tmp_path)
35 runner = git_status_runner(tip="cafebabe")
36 start = time.monotonic()
37 code = run_cli(
38 ["status", "--json", "--exit-code"],
39 cwd=tmp_path,
40 runner=runner,
41 json_mode=True,
42 )
43 elapsed = time.monotonic() - start
44 capsys.readouterr()
45 assert code == 0
46 assert elapsed < 2.0
File History 2 commits
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14 Reconcile reviewed credential compatibility 32254cd939885d9… Human patch 8 days ago
sha256:c87cf2c2f03da507f66f93922cb339a2cbebb33ad6372a6039032fb09a20da12 Reconcile reviewed Overseer recovery d47291d5d9030de5ebef71… Human minor ⚠ 8 days ago