test_full_install_cycle.py python
51 lines 1.6 KB
Raw
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago
1 """End-to-end install lifecycle test."""
2
3 from __future__ import annotations
4
5 from pathlib import Path
6
7 from cli.version_lock import read_version_lock
8 from tests.support import git_status_runner, run_cli
9 from tools.governance_freshness import GovernanceFreshnessReport
10 from unittest.mock import patch
11
12
13 _OK_FRESHNESS = GovernanceFreshnessReport(
14 state="ok", message="patched", remediation=None
15 )
16
17
18 def test_full_install_cycle(tmp_path: Path) -> None:
19 assert run_cli(
20 ["init", "--regime", "git-only", "--repo-name", "demo", "--non-interactive"],
21 cwd=tmp_path,
22 runner=git_status_runner(),
23 ) == 0
24
25 handover = tmp_path / "docs" / "DEMO-OVERSEER-HANDOVER.md"
26 handover.write_text(handover.read_text(encoding="utf-8") + "\n# local edit\n", encoding="utf-8")
27
28 with patch("cli.commands.status.check_governance_freshness", return_value=_OK_FRESHNESS):
29 assert run_cli(
30 ["status", "--check-footprint", "--exit-code"],
31 cwd=tmp_path,
32 runner=git_status_runner(),
33 ) == 6
34
35 assert run_cli(["sync", "-y"], cwd=tmp_path, runner=git_status_runner()) == 4
36
37 assert run_cli(
38 ["sync", "-y", "--force"],
39 cwd=tmp_path,
40 runner=git_status_runner(),
41 ) == 0
42
43 lock = read_version_lock(tmp_path / ".overseer" / "version.lock")
44 assert lock.kit_version == "0.1.0"
45
46 with patch("cli.commands.status.check_governance_freshness", return_value=_OK_FRESHNESS):
47 assert run_cli(
48 ["status", "--check-footprint"],
49 cwd=tmp_path,
50 runner=git_status_runner(),
51 ) == 0
File History 1 commit
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago