From 68fecc6de4b2e6556adeb2730798bf42017c4be6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Mar 2024 14:25:39 -0400 Subject: fix: less aggressive vendor folder ignoring (#23100) This is slightly breaking as some users want the `vendor` folder excluded and may not have that specified in their deno.json. Closes #22833 --- cli/tools/bench/mod.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'cli/tools/bench') diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs index 609dff282..8663fbbc8 100644 --- a/cli/tools/bench/mod.rs +++ b/cli/tools/bench/mod.rs @@ -432,8 +432,11 @@ pub async fn run_benchmarks( let permissions = Permissions::from_options(&cli_options.permissions_options())?; - let specifiers = - collect_specifiers(bench_options.files, is_supported_bench_path)?; + let specifiers = collect_specifiers( + bench_options.files, + cli_options.vendor_dir_path().map(ToOwned::to_owned), + is_supported_bench_path, + )?; if specifiers.is_empty() { return Err(generic_error("No bench modules found")); @@ -505,6 +508,7 @@ pub async fn run_benchmarks_with_watch( let bench_modules = collect_specifiers( bench_options.files.clone(), + cli_options.vendor_dir_path().map(ToOwned::to_owned), is_supported_bench_path, )?; @@ -543,11 +547,14 @@ pub async fn run_benchmarks_with_watch( // todo(dsherret): why are we collecting specifiers twice in a row? // Seems like a perf bug. - let specifiers = - collect_specifiers(bench_options.files, is_supported_bench_path)? - .into_iter() - .filter(|specifier| bench_modules_to_reload.contains(specifier)) - .collect::>(); + let specifiers = collect_specifiers( + bench_options.files, + cli_options.vendor_dir_path().map(ToOwned::to_owned), + is_supported_bench_path, + )? + .into_iter() + .filter(|specifier| bench_modules_to_reload.contains(specifier)) + .collect::>(); check_specifiers(cli_options, module_load_preparer, specifiers.clone()) .await?; -- cgit v1.2.3