test_k7_footprint_check.py python
52 lines 1.7 KB
Raw
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 2 days ago
1 """Performance tests for K7 status --check-footprint with bridge files (§K7.8 performance tier)."""
2
3 from __future__ import annotations
4
5 import time
6 from pathlib import Path
7
8 from cli.footprint import MUSE_BRIDGE_WORKFLOW_DEST
9 from tests.support import FIXTURES, muse_mirror_status_runner, run_cli, seed_muse_substrate
10
11
12 def test_check_footprint_bounded_with_bridge_files(tmp_path: Path) -> None:
13 runner = muse_mirror_status_runner(tmp_path)
14 assert (
15 run_cli(
16 [
17 "init",
18 "--from-config",
19 str(FIXTURES / "config-muse-git-mirror.yaml"),
20 "--non-interactive",
21 ],
22 cwd=tmp_path,
23 runner=runner,
24 )
25 == 0
26 )
27 seed_muse_substrate(tmp_path)
28 workflow = tmp_path / MUSE_BRIDGE_WORKFLOW_DEST
29 workflow.write_text(workflow.read_text(encoding="utf-8") + ("\n# padding\n" * 2000), encoding="utf-8")
30
31 start = time.perf_counter()
32 code = run_cli(["status", "--check-footprint", "--exit-code"], cwd=tmp_path, runner=runner)
33 elapsed = time.perf_counter() - start
34 assert code == 6 # footprint integrity mismatch (--exit-code precedence)
35 assert elapsed < 5.0
36
37 # Restore kit bytes and confirm fast OK path
38 run_cli(
39 [
40 "init",
41 "--from-config",
42 str(FIXTURES / "config-muse-git-mirror.yaml"),
43 "--non-interactive",
44 "--force",
45 ],
46 cwd=tmp_path,
47 runner=runner,
48 )
49 start = time.perf_counter()
50 assert run_cli(["status", "--check-footprint"], cwd=tmp_path, runner=runner) == 0
51 elapsed = time.perf_counter() - start
52 assert elapsed < 5.0
File History 2 commits
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 2 days ago
sha256:4671b7f787ddbe63ced31c895b688c77ab495653b65a730b423329f26b3c1439 feat: K1-P1 complete — agent provenance, build-verification… Sonnet 4.6 patch 54 days ago