Conversation
…ng crate - Introduce wireframe_testing crate to share test utilities across integration tests - Provide CommonTestEnvelope with correlation support for testing - Add default TestApp type and factory fixture for app creation - Implement unused_listener helper to bind to ephemeral localhost port - Remove tests/common/mod.rs and migrate usages to wireframe_testing crate - Update all test crates to use wireframe_testing helpers to reduce duplication and lint suppressions - Document usage of integration_helpers module in wireframe_testing/README.md This improves test code reuse, reduces compilation duplication, and enables consistent test fixtures and helpers across multiple test crates. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Reviewer's GuideCentralizes shared integration test helpers into a new wireframe_testing::integration_helpers module, re-exports its main types from the crate root, updates integration tests to consume them, and refreshes documentation to describe the new workflow and migration notes. Class diagram for wireframe_testing integration_helpers moduleclassDiagram
class CommonTestEnvelope {
+u32 id
+Option~u64~ correlation_id
+Vec~u8~ payload
+correlation_id() Option~u64~
+set_correlation_id(correlation_id Option~u64~) void
+id() u32
+into_parts() PacketParts
+from_parts(parts PacketParts) CommonTestEnvelope
}
class CorrelatableFrame {
<<trait>>
+correlation_id() Option~u64~
+set_correlation_id(correlation_id Option~u64~) void
}
class Packet {
<<trait>>
+id() u32
+into_parts() PacketParts
+from_parts(parts PacketParts) Self
}
class PacketParts {
+id() u32
+correlation_id() Option~u64~
+into_payload() Vec~u8~
+new(id u32, correlation_id Option~u64~, payload Vec~u8~) PacketParts
}
class WireframeApp {
<<generic>>
-BincodeSerializer serializer
-unit_envelope Envelope
}
class BincodeSerializer {
<<type>>
}
class Envelope {
<<type_parameter>>
}
class TestApp {
<<type_alias>>
+alias_of WireframeApp~BincodeSerializer, (), Envelope~
}
class TestResult {
<<type_alias>>
+alias_of Result~T, Box~dyn Error + Send + Sync~~
}
class factory {
<<fixture_function>>
+factory() Fn() -> TestApp + Send + Sync + Clone + 'static
}
class unused_listener_fn {
<<function>>
+unused_listener() Result~StdTcpListener, std::io::Error~
}
CommonTestEnvelope ..|> CorrelatableFrame
CommonTestEnvelope ..|> Packet
PacketParts o-- CommonTestEnvelope
WireframeApp o-- BincodeSerializer
WireframeApp o-- Envelope
TestApp ..|> WireframeApp
TestResult ..|> Result
factory ..> TestApp
unused_listener_fn ..> StdTcpListener
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughMove shared integration test helpers into a new public Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
…on tests - Added CommonTestEnvelope::new and with_payload constructors for easier test envelope creation. - Implemented tests validating CommonTestEnvelope behavior and unused_listener helper. - Added comprehensive integration tests covering wireframe_testing helpers like factory and unused_listener. - Updated re-exports in test fixtures to use wireframe_testing::TestResult. - Improved type annotations and test helper patterns in wireframe_testing. This enhances the testing infrastructure and integration helper usability for downstream consumers. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
|
@coderabbitai Have the following now been resolved? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 5518 🏁 Script executed: Length of output: 1909
Overall Comments✅ IPv6/flexibility: ✅ Helper constructors: Added both Individual Comments✅ Comment 1 (Tests): All required tests are present:
✅ Comment 2 (Spelling): Changed from "Serialised" to "Serialized" on line 52, conforming to en-GB-oxendict (-ize) spelling. All issues are now addressed. |
…nection handling - Introduce `AppFactory` trait to replace direct function signature for app construction. - Implement `FactoryResult` for flexible factory output conversion. - Refine connection spawning to utilize `AppFactory` and handle build errors gracefully. - Remove deprecated `ConnectionApp` trait and simplify connection processing logic. - Update related server, runtime, and config modules to use the new factory abstraction. - Improve error logging and reduce clone bounds by removing unnecessary trait bounds. - Minor cleanup and imports reorganization related to factory usage. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/server/runtime.rs (1)
274-336:⚠️ Potential issue | 🟡 MinorUpdate the
accept_looptype-parameter docs to referenceAppFactory, not a “factory function”.
Align the Rustdoc with the new trait-based factory abstraction.
🤖 Fix all issues with AI agents
In `@wireframe_testing/tests/integration_helpers.rs`:
- Around line 42-50: The test currently compares response.payload to an
allocated Vec via vec![1, 2, 3], causing an unnecessary allocation; update the
comparison in the function containing response checks (the block that verifies
response.id, response.payload, and response.correlation_id in
wireframe_testing::tests::integration_helpers) to compare against a slice
literal instead (e.g., use & [1, 2, 3] or &[1,2,3] depending on payload type) so
the check uses a borrowable slice and avoids allocating a new Vec.
…yload comparison - Updated doc comments in src/server/runtime.rs to refer to AppFactory trait for clarity. - Changed payload comparison in integration_helpers.rs from vector equality to slice equality for efficiency and correctness. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/server/runtime.rs (2)
388-396: 🧹 Nitpick | 🔵 TrivialSimplify the clone invocation.
The explicit dereference in
(*factory).clone()is unnecessary. WhenF: Clone, calling.clone()on&Fautomatically produces an ownedF.♻️ Proposed simplification
res = listener.accept() => Some(match res { Ok((stream, _)) => { spawn_connection_task( stream, - (*factory).clone(), + factory.clone(), handles.preamble.clone(), handles.tracker, );
1-6: 🧹 Nitpick | 🔵 TrivialFile length exceeds 400-line limit.
At 406 lines, this file marginally exceeds the 400-line guideline. Decompose in a future refactor—extracting
AcceptLoopOptions,AcceptHandles, andPreambleHooksinto a separate submodule would reduce complexity.
… accept.rs module Extract accept loop utilities, AcceptListener trait, PreambleHooks, and related types from runtime.rs into a dedicated accept.rs module under server/runtime. This improves code organization by separating the accept loop functionality and its dependencies from the main runtime control logic of WireframeServer. No behavioral changes, preserving existing functionality while making the codebase cleaner and more modular. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Summary
Changes
Core
Integrations helpers and exports
Documentation
Tests
Migration notes
Test plan
◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/daed61f9-98b1-47c5-a303-59dbf443fb3f
📝 Closes #433
Summary by Sourcery
Centralize shared integration test helpers in the wireframe_testing crate and update tests and docs to use the new integration_helpers module.
New Features:
Enhancements:
Documentation: