//! Layer 3 integration test entry point (D-030, ticket #200). //! //! ## Three-layer test architecture (D-030 sub-decision 3) //! //! ```text //! Layer 1 — Fixture-based serialization (FAST, run on every edit) //! Scope: Pure unit tests. No ECS world. No subprocess. //! Tools: Rust #[test] + data structures directly. //! Speed: <1ms each. //! Files: tests/serialization.rs, tests/information_boundaries.rs (Layer 1 tests), //! #[cfg(test)] mod tests within src/ modules //! //! Layer 2 — Mock subprocess / minimal ECS world (MEDIUM, run on every PR) //! Scope: Minimal bevy App or World. Real systems, no real subprocess. //! IPC roundtrip over Unix socket without spawning the binary. //! Tools: bevy_ecs World + Schedule, or LocalBridge with in-process simulation. //! Speed: 1ms–100ms each. //! Files: tests/bridge_ipc.rs, tests/bridge_tcp.rs, //! tests/information_boundaries.rs (Layer 2 tests), //! tests/determinism.rs, tests/movement.rs, tests/smoke.rs //! //! Layer 3 — Real subprocess integration (SLOW, run daily / pre-merge) //! Scope: Full binary spawned as a child process. No mocks. Real IPC. //! Exercises the complete path: spawn → handshake → tick → snapshot. //! Tools: std::process::Command, TcpStream. //! Speed: 1s–15s each (process startup dominates). //! Files: tests/layer3.rs, tests/integration/ (this module) //! ``` //! //! ## Layer 3 test guidelines //! //! - Always set a deadline for server startup (`LISTEN_TIMEOUT`). //! - Always kill the child process in teardown (even on test failure — use a //! RAII guard or drop the handle at end of test). //! - Use `--port 0` to get a kernel-assigned port; parse `LISTENING:{port}` from //! stdout to obtain the actual port. //! - Serialize `PlayerInput` via `rmp_serde`, frame with `bridge::framing::write_framed`. //! - Deserialize `ObserverSnapshot` via `rmp_serde` after `bridge::framing::read_framed`. //! //! Spec reference: D-030 (testability architecture), D-020 (subprocess IPC protocol) // --------------------------------------------------------------------------- // Stub: Layer 3 startup smoke test // --------------------------------------------------------------------------- /// Placeholder for future Layer 3 tests that require full subprocess setup. /// /// Non-blocking tests that exercise the simulation binary end-to-end live in /// `tests/layer3.rs`. This module is the organisational entry point for tests /// that exercise multi-message Layer 3 scenarios (multi-tick sequences, /// save/load roundtrip over IPC, protocol version negotiation). /// /// See `tests/layer3.rs::server_subprocess_sends_snapshot_on_connect` for the /// canonical Layer 3 pattern. #[test] fn layer3_module_entry_point_placeholder() { // This test exists to verify the integration module compiles and is // discovered by cargo test. Real Layer 3 scenario tests replace this. // D-030 Layer 3 stubs are acceptable until the IPC handshake (#555) lands. }