mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-02 17:45:46 +01:00
Add precommands to workloads
This commit is contained in:
parent
ba75d23bfe
commit
c9a0b1a201
@ -22,6 +22,8 @@ pub struct Workload {
|
|||||||
pub run_count: u16,
|
pub run_count: u16,
|
||||||
pub extra_cli_args: Vec<String>,
|
pub extra_cli_args: Vec<String>,
|
||||||
pub assets: BTreeMap<String, Asset>,
|
pub assets: BTreeMap<String, Asset>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub precommands: Vec<super::command::Command>,
|
||||||
pub commands: Vec<super::command::Command>,
|
pub commands: Vec<super::command::Command>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +39,15 @@ async fn run_commands(
|
|||||||
let report_folder = &args.report_folder;
|
let report_folder = &args.report_folder;
|
||||||
let workload_name = &workload.name;
|
let workload_name = &workload.name;
|
||||||
|
|
||||||
|
for batch in workload
|
||||||
|
.precommands
|
||||||
|
.as_slice()
|
||||||
|
.split_inclusive(|command| !matches!(command.synchronous, SyncMode::DontWait))
|
||||||
|
{
|
||||||
|
super::command::run_batch(meili_client, batch, &workload.assets, &args.asset_folder)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
std::fs::create_dir_all(report_folder)
|
std::fs::create_dir_all(report_folder)
|
||||||
.with_context(|| format!("could not create report directory at {report_folder}"))?;
|
.with_context(|| format!("could not create report directory at {report_folder}"))?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user