From 3d6be71a30d4301a5a7eeb6dda4b6f7d59a701ec Mon Sep 17 00:00:00 2001 From: Karol Sewilo Date: Mon, 13 Jan 2025 14:09:46 +0100 Subject: [PATCH] Add spinner for coverage and profiler commit-id:cf9e095e --- crates/forge-runner/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/forge-runner/src/lib.rs b/crates/forge-runner/src/lib.rs index 93fee082b5..5cbba62a38 100644 --- a/crates/forge-runner/src/lib.rs +++ b/crates/forge-runner/src/lib.rs @@ -13,6 +13,7 @@ use futures::StreamExt; use package_tests::with_config_resolved::TestCaseWithResolvedConfig; use profiler_api::run_profiler; use shared::print::print_as_warning; +use shared::spinner; use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; @@ -68,7 +69,9 @@ pub fn maybe_save_trace_and_profile( let name = sanitize_filename::sanitize(name.replace("::", "_")); let trace_path = save_trace_data(&name, trace_data)?; if execution_data_to_save.profile { + let spinner = spinner::create_with_message("Running cairo-profiler"); run_profiler(&name, &trace_path, &execution_data_to_save.additional_args)?; + spinner.finish_and_clear(); } return Ok(Some(trace_path)); } @@ -84,10 +87,12 @@ pub fn maybe_generate_coverage( if saved_trace_data_paths.is_empty() { print_as_warning(&anyhow!("No trace data to generate coverage from")); } else { + let spinner = spinner::create_with_message("Running cairo-coverage"); run_coverage( saved_trace_data_paths, &execution_data_to_save.additional_args, )?; + spinner.finish_and_clear(); } } Ok(())