Skip to content

Commit

Permalink
Gracefully handle missing XDG_RUNTIME_DIR env var in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetf committed Jun 24, 2024
1 parent 8d46106 commit ab291a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shpool/tests/support/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ impl Proc {
.arg("--socket")
.arg(&self.socket_path)
.env_clear()
.env("XDG_RUNTIME_DIR", env::var("XDG_RUNTIME_DIR")?)
.env("SHPOOL_TEST_HOOK_SOCKET_PATH", &test_hook_socket_path)
.envs(args.extra_env)
.arg("attach");
if let Ok(xdg_runtime_dir) = env::var("XDG_RUNTIME_DIR") {
cmd.env("XDG_RUNTIME_DIR", xdg_runtime_dir);
}
if args.force {
cmd.arg("-f");
}
Expand Down

0 comments on commit ab291a5

Please sign in to comment.