Skip to content

Commit 5184bf8

Browse files
committed
test: add test log
1 parent c8f8ae2 commit 5184bf8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/libs/kill_tree/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tokio = { version = "1.36.0", features = ["full"], optional = true }
1515

1616
[dev-dependencies]
1717
tokio = { version = "1.36.0", features = ["test-util"] }
18+
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }
1819

1920
[target.'cfg(windows)'.dependencies]
2021
windows = { version = "0.52.0", features = [

crates/libs/kill_tree/tests/test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{process::Command, sync::mpsc, thread, time::Duration};
2+
use tracing_test::traced_test;
23

34
fn get_node_script_infinite() -> String {
45
r"
@@ -25,6 +26,7 @@ fn get_node_script_spawn_infinite_child() -> String {
2526
.to_string()
2627
}
2728

29+
#[traced_test]
2830
#[test]
2931
fn kill_tree_default() {
3032
let (tx, rx) = mpsc::channel();
@@ -50,6 +52,7 @@ fn kill_tree_default() {
5052
} => {
5153
assert_eq!(*process_id, target_process_id);
5254
assert_eq!(*parent_process_id, std::process::id());
55+
// There are cases where the process does not start with node, so a log is left for confirmation.
5356
println!("name: {name}");
5457
assert!(name.starts_with("node"));
5558
}
@@ -99,6 +102,7 @@ fn kill_tree_with_config_sigkill() {
99102
thread.join().unwrap();
100103
}
101104

105+
#[traced_test]
102106
#[test]
103107
fn kill_tree_with_config_include_target_false() {
104108
let (tx, rx) = mpsc::channel();

0 commit comments

Comments
 (0)