Conversation
Reviewer's GuideThis PR introduces a new Class diagram for the new wireframe_testing crateclassDiagram
class TestSerializer {
<<trait>>
+Serializer
+FrameMetadata<Frame = Envelope>
+Send
+Sync
+'static
}
class WireframeApp {
}
class Packet {
<<trait>>
}
class drive_with_frame {
+async fn drive_with_frame(app, frame) -> io::Result<Vec<u8>>
}
class drive_with_frame_with_capacity {
+async fn drive_with_frame_with_capacity(app, frame, capacity) -> io::Result<Vec<u8>>
}
class drive_with_frames {
+async fn drive_with_frames(app, frames) -> io::Result<Vec<u8>>
}
class drive_with_frames_with_capacity {
+async fn drive_with_frames_with_capacity(app, frames, capacity) -> io::Result<Vec<u8>>
}
class drive_with_bincode {
+async fn drive_with_bincode(app, msg) -> io::Result<Vec<u8>>
}
TestSerializer <|.. WireframeApp : uses
drive_with_frame ..> WireframeApp : app param
drive_with_frame_with_capacity ..> WireframeApp : app param
drive_with_frames ..> WireframeApp : app param
drive_with_frames_with_capacity ..> WireframeApp : app param
drive_with_bincode ..> WireframeApp : app param
drive_with_bincode ..> TestSerializer : S param
drive_with_frame ..> TestSerializer : S param
drive_with_frame_with_capacity ..> TestSerializer : S param
drive_with_frames ..> TestSerializer : S param
drive_with_frames_with_capacity ..> TestSerializer : S param
drive_with_bincode ..> Packet : E param
drive_with_frame ..> Packet : E param
drive_with_frame_with_capacity ..> Packet : E param
drive_with_frames ..> Packet : E param
drive_with_frames_with_capacity ..> Packet : E param
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThis change removes local test utilities for driving the WireframeApp and replaces them with equivalent functions from a new external crate, Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Function
participant Helpers as wireframe_testing::helpers
participant App as WireframeApp
participant Stream as DuplexStream
Test->>Helpers: drive_with_frame(app, frame)
Helpers->>Stream: Create duplex stream
Helpers->>App: Spawn handle_connection(server_side)
Helpers->>Stream: Write frame(s) to client_side
Helpers->>Stream: Shutdown client_side write
Helpers->>Stream: Read all output from client_side
Helpers->>App: Await handle_connection completion
Helpers-->>Test: Return output bytes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🔇 Additional comments (12)
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
Absence of Expected Change Pattern
- wireframe/tests/routes.rs is usually changed with: wireframe/tests/util.rs
Quality Gate Profile: Pay Down Tech Debt
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
Cargo.toml(1 hunks)tests/metadata.rs(3 hunks)tests/routes.rs(3 hunks)tests/util.rs(0 hunks)wireframe_testing/Cargo.toml(1 hunks)wireframe_testing/src/helpers.rs(1 hunks)wireframe_testing/src/lib.rs(1 hunks)
💤 Files with no reviewable changes (1)
- tests/util.rs
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-test
🔇 Additional comments (8)
wireframe_testing/Cargo.toml (1)
1-4: Verify Rust edition and complete package metadata.Rust currently recognises editions "2015", "2018", and "2021". Please confirm that
"2024"is supported by your toolchain. Additionally, consider adding standard manifest fields (authors,description,license) to make this crate ready for future publishing.⛔ Skipped due to learnings
Learnt from: leynos PR: leynos/mxd#137 File: postgres_setup_unpriv/Cargo.toml:4-4 Timestamp: 2025-06-16T23:32:38.317Z Learning: Rust Edition 2024 is a valid and finalized edition that was officially released as part of Rust 1.85.0 on February 20, 2025. It can be used in Cargo.toml files with `edition = "2024"`.Cargo.toml (1)
4-4: Verify Rust edition and development path.Ensure that
"edition = \"2024\""is valid in your Rust toolchain, and confirm that thewireframe_testingdev-dependency path correctly points to the new crate location.Also applies to: 17-17
tests/metadata.rs (1)
12-12: LGTM: external test helper import.Replacing the old local
utilwithwireframe_testing::drive_with_framecleanly centralises test utilities.tests/routes.rs (1)
15-15: LGTM: import external test helpers.Switching to
wireframe_testing::{drive_with_frame, drive_with_frames}aligns with the new crate structure.wireframe_testing/src/lib.rs (1)
1-1: Confirm presence of the helpers module.The declaration
pub mod helpers;requires a correspondingsrc/helpers.rsorsrc/helpers/mod.rs. Please verify that it was included in the PR to avoid build errors.wireframe_testing/src/helpers.rs (3)
1-8: Imports look comprehensive and appropriate.All necessary dependencies are imported for the testing functionality provided by this module.
10-17: Well-designed trait alias for test requirements.The
TestSerializertrait effectively combines all the necessary bounds for testing scenarios, and the blanket implementation provides a clean interface.
21-56: Good layered design with sensible defaults.The helper functions provide a clean API with appropriate defaults, properly delegating to the core implementation with capacity control.
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| metadata.rs | 9.39 → 10.00 | Code Duplication |
Absence of Expected Change Pattern
- wireframe/tests/routes.rs is usually changed with: wireframe/tests/util.rs
Quality Gate Profile: Pay Down Tech Debt
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| metadata.rs | 9.39 → 10.00 | Code Duplication |
Absence of Expected Change Pattern
- wireframe/tests/routes.rs is usually changed with: wireframe/tests/util.rs
Quality Gate Profile: Pay Down Tech Debt
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| metadata.rs | 9.39 → 10.00 | Code Duplication |
Absence of Expected Change Pattern
- wireframe/tests/routes.rs is usually changed with: wireframe/tests/util.rs
Quality Gate Profile: Pay Down Tech Debt
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
wireframe_testingcrate with helpers for driving apps using in-memory streamstests/util.rshelpers with the new cratewireframe_testingTesting
make lintmake testhttps://chatgpt.com/codex/tasks/task_e_68589871047483229b02216bd79aedeb
Summary by Sourcery
Introduce a dedicated wireframe_testing crate for driving WireframeApp instances over in-memory streams and migrate existing tests to use its utilities
New Features:
Enhancements:
Build:
Tests:
Summary by CodeRabbit