test: hide progress spinners in test runs
Steady-tick spinner threads redraw straight to the real stderr, bypassing both the harness capture and the per-test log files: 'Scaffolding' lines from the pkh new tests kept leaking between test results. The scaffold tests now pass a hidden draw target (the only MultiProgress not created by the CLI).
This commit is contained in:
+6
-1
@@ -331,7 +331,12 @@ mod tests {
|
||||
) -> Result<ScaffoldOutcome, Box<dyn Error>> {
|
||||
let previous = std::env::current_dir()?;
|
||||
std::env::set_current_dir(dir)?;
|
||||
let result = scaffold(opts, &MultiProgress::new());
|
||||
// Hidden draw target: in tests the spinner would redraw from its
|
||||
// steady-tick thread straight to the real stderr
|
||||
let result = scaffold(
|
||||
opts,
|
||||
&MultiProgress::with_draw_target(crate::ui::progress_draw_target()),
|
||||
);
|
||||
std::env::set_current_dir(previous)?;
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user