1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! # Replay-based testing
//!
//! Run node logic against recorded MCAP fixtures and assert on topics, latency,
//! and dropped messages.
//!
//! Use the [`clankers::replay_test`](https://docs.rs/clankers/latest/clankers/attr.replay_test.html)
//! attribute macro from the facade, or call [`ReplayContext`] directly in `#[tokio::test]`:
//!
//! ```
//! 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();
//! }
//! ```
//!
//! ## Assertion helpers
//!
//! | 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 |
pub use ;
pub use ;