test_full_install_cycle.py python
51 lines 1.6 KB
Raw
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14 Reconcile reviewed credential compatibility 32254cd939885d9… Human patch 8 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 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