-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmark: improve cli error message #12421
Conversation
benchmark/_cli.js
Outdated
for (const scripts of benchmarks[category]) { | ||
if (filter && scripts.lastIndexOf(filter) === -1) continue; | ||
|
||
paths.push(path.join(category, scripts)); | ||
} | ||
} | ||
|
||
if (paths.length === 0) | ||
throw new Error('No benchmarks found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'd add "in the current folder", but I don't run this often enough anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be confusing IMHO. The CLI searches all of the benchmark/ subdirectories for benchmarks specified on the command line. It never searches the current working directory.
When no matching benchmark files are found, a more sensible error is shown now.
43926b1
to
3ca50a7
Compare
I've tweaked this a bit after I discovered there is already a benchmark count check both in run.js and _cli.js. |
@@ -35,7 +35,7 @@ const runs = cli.optional.runs ? parseInt(cli.optional.runs, 10) : 30; | |||
const benchmarks = cli.benchmarks(); | |||
|
|||
if (benchmarks.length === 0) { | |||
console.error('no benchmarks found'); | |||
console.error('No benchmarks found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches the casing used in run.js.
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in ccdcd91 |
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Marking as |
When no matching benchmark files are found, a more sensible error is thrown now.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)