From d30e863fae2da619849552ca8a9f6844ca471630 Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Wed, 29 Jul 2026 17:02:35 +0200 Subject: [PATCH] test(e2e): hand the serve test's share to the daemon, not the run The serving process built its arguments by hand, so in daemon mode --shared-dir stayed on the attached run, where shares belong to the daemon and the flag is ignored. The daemon fell back to sharing its default folder - which on a developer machine contains the probe files earlier buggy runs deposited, so the test only passed by finding served.bin in leftovers. args_with routes the share to the process whose session does the sharing in either mode. --- soulseek-rs/tests/cli_e2e.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/soulseek-rs/tests/cli_e2e.rs b/soulseek-rs/tests/cli_e2e.rs index ce85d06..d295c5f 100644 --- a/soulseek-rs/tests/cli_e2e.rs +++ b/soulseek-rs/tests/cli_e2e.rs @@ -2124,20 +2124,19 @@ fn serve_stays_online_and_reports_an_upload_a_peer_pulls() { std::fs::write(share.path().join("served.bin"), probe_bytes()) .expect("share file"); - // A serving process: online, sharing, streaming upload records. - let mut args = server.args("cli_e2e_server"); + // A serving process: online, sharing, streaming upload records. The share + // is a session flag: in daemon mode it must reach the daemon, whose + // session does the sharing — handed to the run itself it would be + // silently ignored and the daemon would serve its default folder. + let mut args = server.args_with( + "cli_e2e_server", + &["--shared-dir".to_string(), share.display()], + ); args.retain(|arg| arg != "--quiet"); args.extend( - [ - "--shared-dir", - &share.display(), - "--json", - "serve", - "--duration", - "25", - ] - .iter() - .map(|a| (*a).to_string()), + ["--json", "serve", "--duration", "25"] + .iter() + .map(|a| (*a).to_string()), ); let refs: Vec<&str> = args.iter().map(String::as_str).collect(); let child = command(&refs)