test_full_install_cycle.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
9 hours 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:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
9 hours ago