radicle-cli icon indicating copy to clipboard operation
radicle-cli copied to clipboard

Tests don't seem to set up the ssh agent properly

Open viraptor opened this issue 3 years ago • 3 comments

I'm running into this failure from tests:

running 1 test
** Passing a plain-text password is considered insecure. Please only use for testing purposes.

Initializing your 🌱 profile and identity

ok Creating your 🌱 Ed25519 keypair...
== Authentication failed could not add ssh key
== Unable to connect to ssh-agent. The environment variable `SSH_AUTH_SOCK` was set, but it points to a nonexistent file or directory.

thread 'main' panicked at 'assertion failed: status?.success()', tests/cli.rs:24:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: core::panicking::panic
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:48:5
   3: cli::auth::can_be_initialized::child::{{closure}}
             at /home/viraptor/Projects/radicle-cli/tests/cli.rs:24:9
   4: cli::auth::can_be_initialized::child
             at /home/viraptor/Projects/radicle-cli/tests/cli.rs:16:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
   6: rusty_fork::fork::fork::{{closure}}
             at /home/viraptor/.asdf/installs/rust/1.58.1/registry/src/github.com-1ecc6299db9ec823/rusty-fork-0.3.0/src/fork.rs:107:23
   7: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:280:13
   8: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panic/unwind_safe.rs:271:9
   9: std::panicking::try::do_call
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
  10: __rust_try
  11: std::panicking::try
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
  12: std::panic::catch_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
  13: rusty_fork::fork::fork_impl
             at /home/viraptor/.asdf/installs/rust/1.58.1/registry/src/github.com-1ecc6299db9ec823/rusty-fork-0.3.0/src/fork.rs:117:15
  14: rusty_fork::fork::fork
             at /home/viraptor/.asdf/installs/rust/1.58.1/registry/src/github.com-1ecc6299db9ec823/rusty-fork-0.3.0/src/fork.rs:103:5
  15: cli::auth::can_be_initialized
             at /home/viraptor/Projects/radicle-cli/tests/cli.rs:16:5
  16: cli::auth::can_be_initialized::{{closure}}
             at /home/viraptor/Projects/radicle-cli/tests/cli.rs:16:5
  17: core::ops::function::FnOnce::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
  18: core::ops::function::FnOnce::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    auth::can_be_initialized

It seems like the expected agent state is not properly managed. Maybe an explicit new agent with the sock in TMP would work?

viraptor avatar Apr 26 '22 07:04 viraptor

Hey @viraptor, thanks for the report. We're planning to fix this issue with #92.

erak avatar May 05 '22 08:05 erak

Hey, I am trying to package radicle-cli for Nix/NixOS.

And auth::can_be_initialized failing with the same error is also preventing me from packaging this. (Along with an issue skipping this test from the Nix side, which is a separate issue unrelated to this repo NixOS/nixpkgs#189533)

0xnook avatar Sep 03 '22 01:09 0xnook

Turns out I radicle-cli is already packed by @amesgen, which correctly starts ssh-agent, so please disregard my previous comment

0xnook avatar Sep 03 '22 04:09 0xnook