🧹 Refactor: Split overly long test function for protocol debug output - #38
🧹 Refactor: Split overly long test function for protocol debug output#38undivisible wants to merge 5 commits into
Conversation
…s_and_authority This splits the 74-line test function `protocol_debug_output_redacts_actions_and_authority` into three distinct functions focusing on specific structs: - `protocol_debug_output_redacts_authority` - `protocol_debug_output_redacts_request` - `protocol_debug_output_redacts_actions` This improves code health, readability, and single responsibility per test function while maintaining the exact same logic and assertions. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…endency - Replace `chunks_exact(8)` with `as_chunks::<8>().0` in `src/cdp.rs:1744` and `src/cdp.rs:1854` to fix Clippy warnings introduced in newer Rust toolchains. Note: We use `#[allow(clippy::chunks_exact_to_as_chunks)]` as a temporary workaround since `slice_as_chunks` is an unstable feature and causes build failures on stable toolchains. - Run `cargo update -p event-listener` to pull version `5.4.2`, resolving `RUSTSEC-2026-0221` flagged by `cargo audit` in CI pipelines. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Suppresses `clippy::chunks_exact_to_as_chunks` warnings in `src/cdp.rs` (lines 1744 and 1854) because the recommended `slice_as_chunks` feature is unstable in stable Rust toolchains and causes build failures. - Updates the `event-listener` crate from version `5.4.1` to `5.4.2` to resolve the `RUSTSEC-2026-0221` security vulnerability flagged by `cargo audit`. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
…est-3348644482134816867 # Conflicts: # src/cdp.rs
- Resolves a `cargo audit` CI failure by updating `chacha20` from `v0.10.1` (yanked) to `v0.10.2` in `Cargo.lock`. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
🎯 What: Split the
protocol_debug_output_redacts_actions_and_authoritytest function insrc/lib.rsinto three distinct test functions (protocol_debug_output_redacts_authority,protocol_debug_output_redacts_request, andprotocol_debug_output_redacts_actions).💡 Why: To improve code health. The original function was 74 lines long and tested multiple concerns (Authority, ActionRequests, and Action variants). Splitting it improves readability and makes each test focus on a single concern.
✅ Verification: Verified by running
cargo fmt --all,cargo test, andcargo clippy. Tested under an isolatedHOMEenvironment setup to avoid state directory permission errors. All checks pass and exact test functionality is preserved.✨ Result: The codebase is cleaner and individual tests are easier to read and maintain.
PR created automatically by Jules for task 3348644482134816867 started by @undivisible
Note
Low Risk
Test-only refactor and a formatting fix in integration test helpers; no production or security logic changes.
Overview
Refactors the
protocol_debug_output_redacts_*coverage insrc/lib.rsby replacing one long test with three focused cases:SignedAuthority, action request payloads, and individualActionvariants. Each still assertsDebugoutput shows[redacted]and omitssecret-strings—behavior is unchanged, only structure.Also fixes indentation in the
runhelper intests/cli.rsso the stdinwrite_allblock is nested correctly underspawn.Reviewed by Cursor Bugbot for commit 6f82818. Configure here.