Make the local chat-host loop explicit and cheap so users can warm the machine once instead of rediscovering environment and guest setup on every session. Add cache-backed daily-loop manifests plus the new `pyro prepare` flow, extend `pyro doctor --environment` with warm/cold/stale readiness reporting, and add `make smoke-daily-loop` to prove the warmed repro-fix reset path end to end. Also fix `python -m pyro_mcp.cli` to invoke `main()` so the new smoke and `dist-check` actually exercise the CLI module, and update the docs/roadmap to present `doctor -> prepare -> connect host -> reset` as the recommended daily path. Validation: `uv lock`, `UV_OFFLINE=1 UV_CACHE_DIR=.uv-cache make check`, `UV_OFFLINE=1 UV_CACHE_DIR=.uv-cache make dist-check`, and `UV_OFFLINE=1 UV_CACHE_DIR=.uv-cache make smoke-daily-loop`.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
|
|
import pytest
|
|
|
|
import pyro_mcp.doctor as doctor_module
|
|
from pyro_mcp.runtime import DEFAULT_PLATFORM
|
|
|
|
|
|
def test_doctor_main_prints_json(
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
capsys: pytest.CaptureFixture[str],
|
|
) -> None:
|
|
class StubParser:
|
|
def parse_args(self) -> argparse.Namespace:
|
|
return argparse.Namespace(platform="linux-x86_64", environment="debian:12")
|
|
|
|
monkeypatch.setattr(doctor_module, "_build_parser", lambda: StubParser())
|
|
monkeypatch.setattr(
|
|
doctor_module,
|
|
"doctor_report",
|
|
lambda *, platform, environment: {
|
|
"platform": platform,
|
|
"environment": environment,
|
|
"runtime_ok": True,
|
|
"issues": [],
|
|
},
|
|
)
|
|
doctor_module.main()
|
|
output = json.loads(capsys.readouterr().out)
|
|
assert output["runtime_ok"] is True
|
|
|
|
|
|
def test_doctor_build_parser_defaults_platform() -> None:
|
|
parser = doctor_module._build_parser()
|
|
args = parser.parse_args([])
|
|
assert args.platform == DEFAULT_PLATFORM
|
|
assert args.environment == "debian:12"
|