Skip to content

🧹 Refactor: Split overly long test function for protocol debug output - #38

Closed
undivisible wants to merge 5 commits into
mainfrom
refactor/split-long-test-3348644482134816867
Closed

🧹 Refactor: Split overly long test function for protocol debug output#38
undivisible wants to merge 5 commits into
mainfrom
refactor/split-long-test-3348644482134816867

Conversation

@undivisible

@undivisible undivisible commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🎯 What: Split the protocol_debug_output_redacts_actions_and_authority test function in src/lib.rs into three distinct test functions (protocol_debug_output_redacts_authority, protocol_debug_output_redacts_request, and protocol_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, and cargo clippy. Tested under an isolated HOME environment 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 in src/lib.rs by replacing one long test with three focused cases: SignedAuthority, action request payloads, and individual Action variants. Each still asserts Debug output shows [redacted] and omits secret- strings—behavior is unchanged, only structure.

Also fixes indentation in the run helper in tests/cli.rs so the stdin write_all block is nested correctly under spawn.

Reviewed by Cursor Bugbot for commit 6f82818. Configure here.

…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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 4 commits August 27, 2026 04:44
…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>
@undivisible

Copy link
Copy Markdown
Contributor Author

Closing: CONFLICTING after sibling merges (#47/#50/#49/#44/#30); Jules extract/split superseded — prefer close over rebase fight.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing: CONFLICTING after sibling merges (#47/#50/#49/#44/#30); Jules extract/split superseded — prefer close over rebase fight.

Understood. Acknowledging that this work is superseded and closing as requested. Stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant