- CLI Rust (am) : list/install/uninstall/update/start/stop/restart/run/status/search/info/config/doctor/completion/export/import/self-update + shell interactif (Tab, historique) - 9 methodes d'installation (npm, pip, uv, cargo, go, bun, curl, binary, git) - catalogue de 72 agents, dependances, processus, securite (dry-run, checksums) - sondes de version paralleles + cache (am list ~25 ms a chaud) - installateurs one-liner : install.sh, install.ps1
38 lines
1.2 KiB
Rust
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"] {
|
|
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());
|
|
}
|