test_preserve_shared_assets_performance.py
python
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
12 hours ago
| 1 | """Performance — preserve-shared-assets migrate bound (§PSA.8).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import time |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from tests.support import PILOT, muse_mirror_status_runner, run_cli, seed_pilot_tree |
| 9 | |
| 10 | MAX_PRESERVE_MIGRATE_SECONDS = 5.0 |
| 11 | |
| 12 | |
| 13 | def test_preserve_shared_migrate_bounded(tmp_path: Path) -> None: |
| 14 | seed_pilot_tree( |
| 15 | tmp_path, |
| 16 | handover_rel="docs/OVERSEER-HANDOVER.md", |
| 17 | handover_text="# H\n", |
| 18 | roadmap_rel="docs/ROADMAP.md", |
| 19 | roadmap_text="# R\n", |
| 20 | ) |
| 21 | policy = tmp_path / ".overseer" / "policy" |
| 22 | policy.mkdir(parents=True, exist_ok=True) |
| 23 | (policy / "tiers.yaml").write_text("altered: true\n", encoding="utf-8") |
| 24 | |
| 25 | start = time.perf_counter() |
| 26 | code = run_cli( |
| 27 | [ |
| 28 | "init", |
| 29 | "--migrate", |
| 30 | "--force", |
| 31 | "--preserve-shared-assets", |
| 32 | "--from-config", |
| 33 | str(PILOT / "config-scooling.yaml"), |
| 34 | "--non-interactive", |
| 35 | ], |
| 36 | cwd=tmp_path, |
| 37 | runner=muse_mirror_status_runner(tmp_path), |
| 38 | ) |
| 39 | elapsed = time.perf_counter() - start |
| 40 | assert code == 0 |
| 41 | assert elapsed < MAX_PRESERVE_MIGRATE_SECONDS |
File History
1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
12 hours ago