test_governance_freshness_performance.py
file-level
1
files
1
commits
0
hotspots
0
🧊 dead
0
💥 blast risk
| 1 | """Performance: status GFG adds no gh invocation (§GFG.9 performance).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from tests.support import FIXTURES, git_status_runner, run_cli, seed_governance_freshness |
| 8 | |
| 9 | |
| 10 | def test_status_exit_code_adds_no_gh_for_gfg(tmp_path: Path) -> None: |
| 11 | runner = git_status_runner() |
| 12 | assert ( |
| 13 | run_cli( |
| 14 | ["init", "--from-config", str(FIXTURES / "config-git-only.yaml"), "--non-interactive"], |
| 15 | cwd=tmp_path, |
| 16 | runner=runner, |
| 17 | ) |
| 18 | == 0 |
| 19 | ) |
| 20 | seed_governance_freshness(tmp_path) |
| 21 | before = len(runner.calls) |
| 22 | run_cli(["status", "--json", "--exit-code"], cwd=tmp_path, runner=runner, json_mode=True) |
| 23 | new_cmds = [cmd for cmd, _ in runner.calls[before:]] |
| 24 | assert not any(cmd.startswith("gh ") or " gh " in f" {cmd}" for cmd in new_cmds) |
| 25 | assert any("git rev-parse origin/main" in cmd for cmd in new_cmds) |