diff --git a/crates/libs/kill_tree/Cargo.toml b/crates/libs/kill_tree/Cargo.toml index fd1baae..52a874c 100644 --- a/crates/libs/kill_tree/Cargo.toml +++ b/crates/libs/kill_tree/Cargo.toml @@ -15,6 +15,7 @@ tokio = { version = "1.36.0", features = ["full"], optional = true } [dev-dependencies] tokio = { version = "1.36.0", features = ["test-util"] } +tracing-test = { version = "0.2.4", features = ["no-env-filter"] } [target.'cfg(windows)'.dependencies] windows = { version = "0.52.0", features = [ diff --git a/crates/libs/kill_tree/tests/test.rs b/crates/libs/kill_tree/tests/test.rs index 36127ce..e1df11d 100644 --- a/crates/libs/kill_tree/tests/test.rs +++ b/crates/libs/kill_tree/tests/test.rs @@ -1,4 +1,5 @@ use std::{process::Command, sync::mpsc, thread, time::Duration}; +use tracing_test::traced_test; fn get_node_script_infinite() -> String { r" @@ -25,6 +26,7 @@ fn get_node_script_spawn_infinite_child() -> String { .to_string() } +#[traced_test] #[test] fn kill_tree_default() { let (tx, rx) = mpsc::channel(); @@ -50,6 +52,7 @@ fn kill_tree_default() { } => { assert_eq!(*process_id, target_process_id); assert_eq!(*parent_process_id, std::process::id()); + // There are cases where the process does not start with node, so a log is left for confirmation. println!("name: {name}"); assert!(name.starts_with("node")); } @@ -99,6 +102,7 @@ fn kill_tree_with_config_sigkill() { thread.join().unwrap(); } +#[traced_test] #[test] fn kill_tree_with_config_include_target_false() { let (tx, rx) = mpsc::channel();