robotrt-cli 0.1.0-beta.2

RobotRT modular robotics runtime and middleware components.
use super::common::*;

#[test]
fn runtime_load_reads_existing_report() {
    let report_path = temp_path("runtime-load", "json");
    let report = RuntimeLoadReport {
        queue_depth: Some(3),
        retransmit_drivers: Some(1),
        backpressure: Some(0.0),
        health: RuntimeHealthView {
            status: "healthy".to_string(),
            reason: None,
        },
        metrics: vec![RuntimeMetricView {
            name: "runtime.queue_depth".to_string(),
            value: 3.0,
            unit: "".to_string(),
        }],
    };
    write_runtime_load_report(&report_path, &report).expect("write runtime report");

    let output = run_cli(&[
        "runtime",
        "load",
        "--report",
        report_path.to_str().expect("utf-8 path"),
        "--json",
    ]);

    assert!(output.status.success(), "stderr: {}", output.stderr);
    assert!(output.stdout.contains("\"queue_depth\":"));
    assert!(output.stdout.contains("\"status\": \"healthy\""));
}