fix(trunk): move T8 #[ignore] full-e2e stub to binary crate tests
Some checks failed
CI / fmt (pull_request) Successful in 1m12s
CI / clippy (pull_request) Failing after 1m31s
CI / test (1.85) (pull_request) Failing after 1m17s
CI / test (stable) (pull_request) Failing after 2m7s
CI / deny (pull_request) Failing after 1m32s
CI / sim-bench (stable) (pull_request) Failing after 1m48s
CI / twilio-live (manual only) (pull_request) Has been skipped

The #[ignore]'d full_pstn_e2e_through_media_thread_register_trunk test
was in crates/rutster-trunk/tests/sim_integ.rs, but rutster-trunk can't
depend on the rutster binary crate (circular dep: rutster already
depends on rutster-trunk). The test needs MediaThread + spawn_tap_engine
which live in the binary crate. Moved to
crates/rutster/tests/trunk_sim_e2e.rs where it can access those types
when implemented. The active pstn_sim_synthetic_caller_drives_trunk_reflex_loop
test stays in rutster-trunk (covers the FOB reflex loop + trunk-leg tick
directly). Also pinned Cargo.lock deps to 1.85-compatible versions
(icu/time/rcgen/dimpl downgrades).

Signed-off-by: Aaron D. Lee <himself@adlee.work>
This commit is contained in:
2026-07-05 12:33:05 -04:00
parent 7815a8b9fc
commit df5b11ae37
3 changed files with 87 additions and 229 deletions

View File

@@ -330,19 +330,3 @@ async fn pstn_sim_synthetic_caller_drives_trunk_reflex_loop() {
let _ = close_tx.send(());
let _ = tokio::time::timeout(Duration::from_secs(1), engine_handle).await;
}
/// Full end-to-end test using the binary's `MediaThread` + `RegisterTrunk`.
///
/// This test is currently ignored because `rutster-trunk` integration tests
/// cannot depend on the `rutster` binary crate (`rutster` already depends on
/// `rutster-trunk`; Cargo disallows circular dev-dependencies). The active
/// `pstn_sim_synthetic_caller_drives_trunk_reflex_loop` above covers the FOB
// reflex loop + trunk-leg tick directly; this stub marks where the MediaThread
/// wiring test belongs once the binary crate is ready to exercise it.
#[ignore]
#[tokio::test]
async fn full_pstn_e2e_through_media_thread_register_trunk() {
// TODO: exercise MediaCmd::RegisterTrunk + MediaThread tick loop against a
// live TwilioMediaStreamsServer mock once the binary crate exposes a test
// harness from the appropriate crate.
}

View File

@@ -0,0 +1,35 @@
//! Full end-to-end PSTN sim via the binary's `MediaThread` + `RegisterTrunk`.
//!
//! This test was moved from `crates/rutster-trunk/tests/sim_integ.rs` because
//! `rutster-trunk` integration tests cannot depend on the `rutster` binary
//! crate (`rutster` already depends on `rutster-trunk`; Cargo disallows
//! circular dev-dependencies). The binary crate has access to
//! `MediaThread`, `MediaCmd::RegisterTrunk`, and `spawn_tap_engine` — the
//! full wiring surface the trunk crate's tests couldn't reach.
//!
//! The active `pstn_sim_synthetic_caller_drives_trunk_reflex_loop` in
//! `crates/rutster-trunk/tests/sim_integ.rs` covers the FOB reflex loop +
//! trunk-leg tick directly. This test extends that to exercise the binary's
//! `MediaThread` command channel + the `RegisterTrunk` spawn seam end-to-end.
#[ignore = "requires MediaThread::RegisterTrunk wiring + MockTwilioMediaStreamsServer; not yet implemented in the binary crate's test harness"]
#[tokio::test]
async fn full_pstn_e2e_through_media_thread_register_trunk() {
// TODO: exercise MediaCmd::RegisterTrunk + MediaThread tick loop against a
// live TwilioMediaStreamsServer mock. The test should:
// 1. Start MockRealtimeBrain.
// 2. Spawn a MediaThread (from crates/rutster/src/media_thread.rs).
// 3. Construct a MockTwilioMediaStreamsServer that pushes synthetic loud
// PcmFrames into a RegisterTrunkInboundChannel.
// 4. Send MediaCmd::RegisterTrunk to the MediaThread.
// 5. Drive the 20ms tick loop for ~500ms.
// 6. Assert barge-in fired (ReflexMetrics.barge_in_count >= 1).
// 7. Assert brain reply observed on the outbound mpsc.
// 8. Assert idle timeout closes the session (ChannelState::Closed).
//
// This requires the binary crate's test harness to expose a way to
// construct a TrunkSession's pipe stack outside the normal axum route
// handler (or to drive the route handler in-process via axum's test
// `oneshot` pattern). Either path is feasible; pick the one that
// matches the existing `barge_in_integration.rs` harness pattern.
}