fix(trunk): move T8 #[ignore] full-e2e stub to binary crate tests (#21)
Some checks failed
CI / twilio-live (manual only) (push) Waiting to run
CI / fmt (push) Successful in 1m13s
CI / clippy (push) Failing after 1m18s
CI / test (1.85) (push) Failing after 1m2s
CI / test (stable) (push) Failing after 1m50s
CI / deny (push) Failing after 1m33s
CI / sim-bench (stable) (push) Failing after 2m4s

Co-authored-by: Aaron D. Lee <himself@adlee.work>
Co-committed-by: Aaron D. Lee <himself@adlee.work>
This commit was merged in pull request #21.
This commit is contained in:
2026-07-05 16:33:43 +00:00
committed by A.D.Lee
parent ee3938864b
commit 431eee3727
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.
}