fix: add missing dev-dependencies to bssh-russh fork#204
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing
[dev-dependencies]block tocrates/bssh-russh/Cargo.tomlso 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), thesrc/tree was copied wholesale from upstream, including its#[cfg(test)] modblocks insrc/client/test.rs,src/keys/mod.rs, andsrc/tests.rs. The matching[dev-dependencies]section was never copied across, socargo test -p bssh-russhhas failed withE0433: unresolved module env_logger/unresolved module tempfileplus cascadingE0282type-inference errors (spawn-agent helpers returntempfile::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 runningcargo 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()insrc/client/test.rs:82(test_client_connects_to_protocol_1_99logs init).tempfile = "3"—tempfile::tempdir()+tempfile::TempDirinsrc/keys/mod.rs:996andsrc/tests.rs:734(spawn-ssh-agent helpers).tokio = { version = "1.52.1", features = ["process", "macros"] }— additive merge with the main tokio dep. Addsprocess(tokio::process::Command::new("ssh-agent").spawn()in the spawn-agent helpers) andmacros(#[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'snet/sync/timefeatures.No source changes; this is purely a Cargo.toml fix.
Test results
cargo test -p bssh-russh --lib— 75 passed / 0 failed / 0 ignored (was: did-not-compile). Coverage that comes back online: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}.test_decode_pkcs8_p{256,384,521}_secret_key,test_decode_ed25519_{,aesctr}_secret_key,test_pkcs8_encrypted,keys::format::test_ec_private_key.tests::channels::{test_channel_objects,test_channel_streams,test_server_channels,test_channel_window_size,test_server_receives_close_on_client_close}.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-46673mitigation) by spawning a realssh-agentover 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 warningsreports ~250 warnings on the newly-reachable test code, dominated byclippy::paniconpanic!("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— cleancargo fmt— applied (no changes needed)cargo clippy --workspace --lib -- -D warnings— cleancargo test -p bssh-russh --lib— 75 passedcargo test --workspace --lib --tests— 1871 passed / 0 failed / 10 ignored