Skip to content

Commit

Permalink
Add spinner for coverage and profiler
Browse files Browse the repository at this point in the history
commit-id:cf9e095e
  • Loading branch information
ksew1 committed Jan 13, 2025
1 parent 1f2c73e commit 3d6be71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/forge-runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand All @@ -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(())
Expand Down

0 comments on commit 3d6be71

Please sign in to comment.