Skip to content

Commit 78a0960

Browse files
committed
testcase span
Signed-off-by: Alex Chi Z <[email protected]>
1 parent cf7c034 commit 78a0960

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/apply.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ where
8080
testcases,
8181
)?;
8282
let mut generated_result = String::new();
83-
for testcase in testcases {
84-
let runner_result = runner.run(&testcase).await;
83+
for (idx, testcase) in testcases.into_iter().enumerate() {
84+
let runner_result = runner
85+
.run(&testcase)
86+
.instrument(if let Some(ref id) = testcase.id {
87+
info_span!("testcase", id = id)
88+
} else {
89+
info_span!("testcase", idx = idx)
90+
})
91+
.await;
8592
if !testcase.no_capture {
8693
generate_result(&testcase, &runner_result, &mut generated_result)?;
8794
}
@@ -95,7 +102,7 @@ where
95102

96103
Ok::<_, Error>(())
97104
}
98-
.instrument(info_span!("planner_test", testname = testname.as_str())),
105+
.instrument(info_span!("file", testname = testname.as_str())),
99106
)
100107
.await
101108
.with_context(|| format!("when joining tokio task for testname={testname}"))?

0 commit comments

Comments
 (0)