CodeVetter · Repo Unpack · Testing signals
rustdesk/rustdesk
Rust tests are unit-style `#[cfg(test)]`/`#[test]` modules embedded across src/ and a dedicated directory for video_qos; Flutter tests use flutter_test in flutter/test. CI exercises builds heavily (flutter-build.yml matrix) and runs a small set of named cargo test filters on Linux plus one flutter test file; there is no end-to-end session/integration test harness — network paths are exercised only in production.
- Rust test framework is plain `cargo test` with tokio::test (tokio test-util in dev-dependencies) plus `hound` and `docopt` dev deps; tests live inline (mod tests) and in dedicated files like src/client/tests/, src/audio_resampler/*_tests.rs, src/server/video_qos/tests/.
- src/server/video_qos/tests/ is the most systematic suite — separate files per concern (baseline, startup, jitter, adaptation, recovery, robustness, invariants, sim, smoke) testing the QoS bitrate controller.
- Audio has dedicated test files on both sides: src/server/audio_service/audio_capture_encoder_tests.rs, audio_capture_queue_tests.rs, src/client/audio_playback_tests.rs, src/client/tests/audio_playback_recovery_tests.rs + audio_state_tests.rs, and src/audio_resampler/{tests,samplerate_tests,allocation_tests}.rs.
- CI runs targeted cargo tests only on the Linux build: `cargo test --locked --lib --features drm drm_capturer_tests`, `cargo test --locked --lib --features drm ipc::test`, and `cargo test --locked -p scrap --features drm hotspot_provenance_tests`/`hotspot_guess_tests`; comments note a test filter matching nothing exits 0, so names must be kept in sync.
- Flutter side has 12 test files in flutter/test covering terminal model/mouse/scroll/keyboard, file_model, cm, cursor_size, quality_monitor_transport, input_modifier_utils, autocomplete_peer_merge, server_settings_dialog; CI runs just `flutter test --timeout 60s test/cursor_size_test.dart`.
- Security-adjacent logic has unit tests: login_failure_check, port_forward_mux, ipc, updater, ui_cm_interface, platform/{windows,linux,mod}, drm_capturer, rdp_input, wayland, terminal_service, portable_service, display_service all contain #[test]/#[tokio::test] markers.
- core_main.rs has a test module verifying is_user_main_ipc_scope_cli_command matches exactly the management commands (--password/--set-unlock-pin/--get-id/--set-id/--config/--option/--assign/--deploy) and not runtime flags like --server/--cm/--connect.
- UNCOVERED: the ~8000-line src/server/connection.rs auth/login/session state machine, src/client.rs's 5800-line transport selection (punch/relay/WebRTC racing), and the Flutter<->Rust session lifecycle have no integration tests; examples/ipc.rs is a manual docopt test harness for IPC only. (inferred)
- Server::new_for_test() exists to construct a Server without real services for unit tests, indicating tests are expected to fake the service registry rather than hit real capture.
- No fuzzing, no property tests, no network-mock harness found; CI 'playground.yml' is a maintainer scratch workflow, not a test gate; docs/CONTRIBUTING.md exists but the scan shows no dedicated testing doc. (inferred)