summaryrefslogtreecommitdiff
path: root/cli/tools/bench/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-27 14:25:39 -0400
committerGitHub <noreply@github.com>2024-03-27 14:25:39 -0400
commit68fecc6de4b2e6556adeb2730798bf42017c4be6 (patch)
treeed7b7644221e4a53f30df3e33d41e7994e10b169 /cli/tools/bench/mod.rs
parent0e4d1cb5f9a3645f6da480b2b8540568fa69d675 (diff)
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
Diffstat (limited to 'cli/tools/bench/mod.rs')
-rw-r--r--cli/tools/bench/mod.rs21
1 files changed, 14 insertions, 7 deletions
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::<Vec<ModuleSpecifier>>();
+ 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::<Vec<ModuleSpecifier>>();
check_specifiers(cli_options, module_load_preparer, specifiers.clone())
.await?;