Skip to content

Commit

Permalink
execute test asset download as part of snippet build
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Sep 12, 2024
1 parent d56d07c commit e9f52b8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/build/re_dev_tools/src/build_examples/snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ impl Snippets {
let snippet_root = snippets_dir.join("all");
let snippets = collect_snippets_recursively(&snippet_root, &config, &snippet_root)?;

println!("Running {} snippets…", snippets.len());
println!("Download test assets…");
let progress = MultiProgress::new();
download_test_assets(&progress)?;

println!("Running {} snippets…", snippets.len());
let results: Vec<anyhow::Result<PathBuf>> = snippets
.into_par_iter()
.map(|example| example.build(&progress, &self.output_dir))
Expand Down Expand Up @@ -190,3 +193,12 @@ struct OptOut {
/// example name -> languages
run: HashMap<String, Vec<String>>,
}

fn download_test_assets(progress: &MultiProgress) -> anyhow::Result<()> {
let download_script = re_build_tools::cargo_metadata()?
.workspace_root
.join("tests/assets/download_test_assets.py");
let mut cmd = Command::new("python3");
cmd.arg(download_script.as_str());
wait_for_output(cmd, "download test assets", progress)
}

0 comments on commit e9f52b8

Please sign in to comment.