{"record":{"id":"6adc0f0dfc0388df","repo":"denoland/deno","slug":"no-bench-modules-found","errorCode":null,"errorMessage":"No bench modules found","messagePattern":"No bench modules found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/bench/mod.rs","lineNumber":491,"sourceCode":"  let specifiers = members_with_bench_options\n    .iter()\n    .map(|(_, bench_options)| {\n      collect_specifiers(\n        CollectSpecifiersOptions {\n          file_patterns: bench_options.files.clone(),\n          vendor_folder: cli_options.vendor_dir_path().map(ToOwned::to_owned),\n          include_ignored_specified: false,\n        },\n        is_supported_bench_path,\n      )\n    })\n    .collect::<Result<Vec<_>, _>>()?\n    .into_iter()\n    .flatten()\n    .collect::<Vec<_>>();\n\n  if !workspace_bench_options.permit_no_files && specifiers.is_empty() {\n    return Err(anyhow!(\"No bench modules found\"));\n  }\n\n  let main_graph_container = factory.main_module_graph_container().await?;\n  main_graph_container\n    .check_specifiers(\n      &specifiers,\n      CheckSpecifiersOptions {\n        ext_overwrite: cli_options.ext_flag().as_ref(),\n        ..Default::default()\n      },\n    )\n    .await?;\n\n  if workspace_bench_options.no_run {\n    return Ok(());\n  }\n\n  let preload_modules = cli_options.preload_modules()?;","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/bench/mod.rs#L473-L509","documentation":"`deno bench` discovered zero bench modules and the run was not started with `--permit-no-files`. Bench discovery matches `*_bench.ts`/`*_bench.tsx` files, `bench/` directories, and `bench.include` globs from deno.json. An empty suite is an error so CI doesn't green-light a suite that silently matched nothing.","triggerScenarios":"Running `deno bench` where no files match the default patterns, where `bench.include`/`bench.exclude` in deno.json filter everything out, or where explicitly passed file arguments are all excluded.","commonSituations":"New projects with no benches yet; benches named `user.test.ts` instead of `user_bench.ts`; running from a workspace member that has no benches while the config lives at the workspace root.","solutions":["Follow the naming convention: `*_bench.ts` files or a `bench/` directory, or pass files explicitly (`deno bench my_file.ts`)","Add a `\"bench\"` field with `\"include\"` globs in deno.json if benches live under non-default names or paths","In CI where an empty suite is expected, pass `--permit-no-files`"],"exampleFix":"# before\n# file named user.test.ts, `deno bench` finds nothing\n\n# after\n# rename to match the convention\nmv user.test.ts user_bench.ts\ndeno bench","handlingStrategy":"validation","validationCode":"// Fail fast with your own message if no bench files will be discovered\nimport { expandGlob } from \"jsr:@std/fs\";\nlet found = false;\nfor await (const _ of expandGlob(\"**/*_bench.ts\")) {\n  found = true;\n  break;\n}\nif (!found) {\n  throw new Error(\"no *_bench.ts files found — check naming or bench.include in deno.json\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow the *_bench.ts / bench/ naming convention","Declare bench.include globs in deno.json when benches live in non-default paths","Use --permit-no-files deliberately in CI where an empty suite is acceptable"],"tags":["bench","file-discovery","ci"],"backgroundTag":"no-test-files-found","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}