Files
agent-manager/tests/doctor_test.rs
T
bruno 890ad953e5 feat: phase 2 quick wins (#65 #69 #72)
- #65: update policies + per-agent version pinning
  - add settings.update_policy (stable/latest/skip)
  - add AgentDef.pin_version
  - honor both in update_cmd
  - add update_policy tests

- #69: REPL color theme CLI command
  - add am theme [name] (show/switch)
  - persist selected theme to config

- #72: doctor checks local model runtimes
  - verify ollama and llama-server on PATH
  - for ollama, also check server responds (ollama ls)

Version 0.4.4
2026-08-17 22:24:45 -04:00

38 lines
1.2 KiB
Rust

//! doctor report: structure and config/state checks.
mod common;
use agent_manager::doctor;
use agent_manager::runner::SystemRunner;
#[test]
fn report_contains_core_checks() {
let app = common::test_app("doctor", &["doctor"]);
let runner = SystemRunner::new(false, false, &app.log);
let report = doctor::run(&app, &runner);
let names: Vec<&str> = report.checks.iter().map(|c| c.name.as_str()).collect();
for expected in ["git", "config", "config-schema", "state", "install-dir", "bin-on-path", "ollama", "llama-server"] {
assert!(
names.contains(&expected),
"missing check '{expected}' in {names:?}"
);
}
// With our isolated test config the schema must be valid.
let schema = report
.checks
.iter()
.find(|c| c.name == "config-schema")
.unwrap();
assert_eq!(schema.status, doctor::Status::Ok);
}
#[test]
fn fix_creates_directories() {
let app = common::test_app("doctorfix", &["doctor"]);
assert!(!app.paths.install_dir.exists());
let repaired = doctor::fix(&app).unwrap();
assert!(repaired.len() >= 2);
assert!(app.paths.install_dir.is_dir());
assert!(app.paths.log_dir.is_dir());
}