Skip to content

fix: add missing dev-dependencies to bssh-russh fork#204

Merged
inureyes merged 1 commit into
mainfrom
fix/bssh-russh-test-dev-deps
May 18, 2026
Merged

fix: add missing dev-dependencies to bssh-russh fork#204
inureyes merged 1 commit into
mainfrom
fix/bssh-russh-test-dev-deps

Conversation

@inureyes
Copy link
Copy Markdown
Member

Summary

Adds the missing [dev-dependencies] block to crates/bssh-russh/Cargo.toml so the fork's inline test modules — imported verbatim from upstream russh — can actually compile and run. Discovered while running the full test suite after PR #203 merged.

Background

When the fork was created in 508aa3f0 ("Sync bssh-russh fork with upstream russh 0.60.0", PR #178), the src/ tree was copied wholesale from upstream, including its #[cfg(test)] mod blocks in src/client/test.rs, src/keys/mod.rs, and src/tests.rs. The matching [dev-dependencies] section was never copied across, so cargo test -p bssh-russh has failed with E0433: unresolved module env_logger / unresolved module tempfile plus cascading E0282 type-inference errors (spawn-agent helpers return tempfile::TempDir) from day one. Nothing in CI exercises that target so it stayed silently broken across ~10 months and several dependency-bump cycles. PR #203 first surfaced it as a side-effect of running cargo clippy -p bssh-russh --all-targets.

Fix

Minimal [dev-dependencies] block covering only what the imported tests actually reference:

  • env_logger = "0.11"env_logger::try_init() in src/client/test.rs:82 (test_client_connects_to_protocol_1_99 logs init).
  • tempfile = "3"tempfile::tempdir() + tempfile::TempDir in src/keys/mod.rs:996 and src/tests.rs:734 (spawn-ssh-agent helpers).
  • tokio = { version = "1.52.1", features = ["process", "macros"] } — additive merge with the main tokio dep. Adds process (tokio::process::Command::new("ssh-agent").spawn() in the spawn-agent helpers) and macros (#[tokio::test]). All other tokio surfaces the tests use — tokio::net::{TcpStream, UnixListener, UnixStream}, tokio::sync::oneshot, tokio::time::sleep — are already covered by the main dep's net / sync / time features.

No source changes; this is purely a Cargo.toml fix.

Test results

cargo test -p bssh-russh --lib75 passed / 0 failed / 0 ignored (was: did-not-compile). Coverage that comes back online:

  • Agent client/server round-trip: test_agent, test_client_agent_{ed25519,rsa,openssh_rsa}, test_request_identities_full_with_keys_and_certs, test_sign_request_{,cert,cert_rsa,cert_rsa_sha512,cert_missing_key_returns_agent_failure,missing_key_returns_agent_failure}.
  • PKCS#8 / OpenSSH key decoding: test_decode_pkcs8_p{256,384,521}_secret_key, test_decode_ed25519_{,aesctr}_secret_key, test_pkcs8_encrypted, keys::format::test_ec_private_key.
  • Channel lifecycle: tests::channels::{test_channel_objects,test_channel_streams,test_server_channels,test_channel_window_size,test_server_receives_close_on_client_close}.
  • Protocol paths: tests::gex::peer_request_accepts_rfc4419_minimum_when_server_can_choose_stronger_group, tests::gex::local_client_config_still_rejects_minimum_below_2048, tests::compress::compress_local_test, tests::future_certificate::test_future_certificate_auth_full_flow, tests::server_kex_junk::server_kex_junk_test.

Notably the agent tests directly exercise the SSH-agent frame-length cap forward-port from PR #203 (CVE-2026-46673 mitigation) by spawning a real ssh-agent over a Unix-domain socket and pumping signed requests through it — giving us real coverage for that fix for the first time.

Full workspace aggregate: 1871 passed / 0 failed / 10 ignored (was 1796 on PR #203's main; the 75 newly-runnable tests account for the delta).

Out of scope

cargo clippy --workspace --tests -- -D warnings reports ~250 warnings on the newly-reachable test code, dominated by clippy::panic on panic!("Unexpected message ...") arms and other idioms upstream russh writes routinely in their test scaffolding. These are inherited verbatim from upstream and don't affect runtime behavior; cleaning them up belongs to a separate follow-up so this PR stays focused on unblocking the test target.

Test plan

  • cargo build — clean
  • cargo fmt — applied (no changes needed)
  • cargo clippy --workspace --lib -- -D warnings — clean
  • cargo test -p bssh-russh --lib — 75 passed
  • cargo test --workspace --lib --tests — 1871 passed / 0 failed / 10 ignored

The fork's inline test modules (src/client/test.rs, src/keys/mod.rs, src/tests.rs) were imported from upstream russh during the initial sync (commit 508aa3f, "Sync bssh-russh fork with upstream russh 0.60.0") but the matching [dev-dependencies] block was never copied across, so every `cargo test -p bssh-russh` since the fork's inception has failed with E0433 on `env_logger`, `tempfile`, and cascading E0282 type-inference errors where helper functions return `tempfile::TempDir`. The test target compiled exactly zero times under our manifest until now.

Adds a minimal [dev-dependencies] block covering only what the imported tests actually reference: `env_logger = "0.11"` for `env_logger::try_init()` in `src/client/test.rs`, `tempfile = "3"` for `tempfile::tempdir()` / `tempfile::TempDir` in `src/keys/mod.rs` and `src/tests.rs`, and `tokio = { version = "1.52.1", features = ["process", "macros"] }` as an additive entry that merges with the main tokio dep to add the `process` feature (needed by the spawn-ssh-agent helpers that call `tokio::process::Command::new("ssh-agent").spawn()`) and the `macros` feature (needed by `#[tokio::test]`). Other tokio surfaces the tests use — `tokio::net::{TcpStream, UnixListener, UnixStream}`, `tokio::sync::oneshot`, `tokio::time::sleep` — were already covered by the main dep's `net`/`sync`/`time` features.

Verification: `cargo test -p bssh-russh --lib` now runs 75 tests (0 failed, 0 ignored) covering the agent client/server roundtrip (test_agent, test_client_agent_{ed25519,rsa,openssh_rsa}, test_request_identities_full_with_keys_and_certs, test_sign_request_{,cert,cert_rsa,cert_rsa_sha512,cert_missing_key_returns_agent_failure,missing_key_returns_agent_failure}), PKCS#8 / OpenSSH key decoding (test_decode_pkcs8_p{256,384,521}_secret_key, test_decode_ed25519_{,aesctr}_secret_key, test_pkcs8_encrypted, format::test_ec_private_key), channel lifecycle (channels::test_{channel_objects,channel_streams,server_channels,channel_window_size,server_receives_close_on_client_close}), and protocol-level paths (gex::peer_request_accepts_rfc4419_minimum_when_server_can_choose_stronger_group, gex::local_client_config_still_rejects_minimum_below_2048, compress::compress_local_test, future_certificate::test_future_certificate_auth_full_flow, server_kex_junk::server_kex_junk_test). Full workspace aggregate is now 1871 passed / 0 failed / 10 ignored, up from 1796 on PR #203 because the 75 newly-runnable bssh-russh tests are now contributing.

Note: `cargo clippy --workspace --tests -- -D warnings` does report ~250 warnings on the newly-reachable test code (mostly `clippy::panic` on `panic!("Unexpected message ...")` arms and similar idioms that upstream russh writes routinely in their test scaffolding). They are inherited verbatim from upstream and don't affect runtime behavior; cleaning them up is a separate follow-up so this PR can stay focused on unblocking the test target.
@inureyes inureyes added type:bug Something isn't working status:review Under review priority:medium Medium priority issue type:test Test related changes labels May 18, 2026
@inureyes inureyes merged commit bec7d69 into main May 18, 2026
1 of 2 checks passed
@inureyes inureyes deleted the fix/bssh-russh-test-dev-deps branch May 18, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:review Under review type:bug Something isn't working type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant