clankers-testing 0.1.4

Replay-based testing tools for clankeRS
Documentation

Run your node logic against recorded MCAP fixtures and assert on topics, latency, and dropped messages — regression tests grounded in real robot logs.

Install

clankers-testing = "0.1"
cargo add clankers-testing

Or use the #[clankers::replay_test] macro from the clankers facade.

Example

use std::time::Duration;
use clankers_testing::{
    assert_max_latency, assert_no_panics, assert_topic_exists, ReplayContext,
};

#[tokio::test]
async fn camera_log_replays_cleanly() {
    let ctx = ReplayContext::new("tests/fixtures/camera_log.mcap");
    let result = ctx.run_replay(|_msg| async { Ok(()) }).await.unwrap();

    assert_no_panics(&result).unwrap();
    assert_topic_exists(&result, "/camera/image_raw").unwrap();
    assert_max_latency(&result, Duration::from_secs(10)).unwrap();
}

Assertions

Function Checks
assert_topic_exists A topic appeared during replay
assert_no_panics Handler completed without panics
assert_dropped_messages Drop count within budget
assert_max_latency p99 latency under a ceiling

Learn more

License

MIT — see LICENSE.