-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in ccdcd91 |
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
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)