-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: fix CLI arguments check in common.js #12429
Conversation
benchmark/common.js
Outdated
@@ -43,7 +43,7 @@ Benchmark.prototype._parseArgs = function(argv, configs) { | |||
// Parse configuration arguments | |||
for (const arg of argv) { | |||
const match = arg.match(/^(.+?)=([\s\S]*)$/); | |||
if (!match || !match[1]) { | |||
if (!match || !match[2]) { |
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.
I think you’re right, but it might be even simpler to change *
to +
in the regex (unless I’m missing something)?
I agree with @addaleax, either we allow passing |
@addaleax, @benjamingr PTL, if I've understood you correctly) |
BTW, why |
I would guess it does not actually matter. It might be nice for scripts to be able to set string parameters to whatever they want, including text containing newlines… ¯\_(ツ)_/¯ |
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in e34f8e1 |
Oops, I goofed and landed this without a CI run (it got batched in with a couple of other ones I was working on landing). Looks like the change breaks test/sequential/test-benchmark.http.js. Revert PR is in. |
@jasnell Sorry, I had to run the CI. Trying to understand how to fix. |
No worries, I should have double checked. I had it grouped in with a set of others that I was landing all together and missed it entirely. |
It seems we do have cases as
Trying to grep another possible cases... |
CI fails only on Windows possibly with ref to #12475 Dear reviewers, could you re-review? |
Post mortem on the original botched landing: I believe that I simply had ended up putting this in the wrong list when I was organizing which PRs to land and which needed more work. This one obviously should have gone in the latter list. Since it was a change to benchmarks and we've only recently added benchmark tests to our CI set, I haven't got myself in the habit yet of running |
@jasnell, @addaleax, @benjamingr, @joyeecheung, @jseijas — Does it still LGTY after the last change? |
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.
Yes, still LGTM :)
Still LGTM |
Still LGTM 👍 |
Still LGTM |
New CI to be sure: https://ci.nodejs.org/job/node-test-pull-request/7519/ |
Timeout in UPD. Waiting for #12518 |
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
CI is OK. Landed in bbbb1f6 |
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12429 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Marking as |
Checklist
Affected core subsystem(s)
benchmark
I can't think up any case when
match
is notnull
whilematch[1]
is falsy here, as the first group does not use a quantifier that can end up in an empty string.So I suppose theHowever, I may miss something obvious.match[2]
is intended to prevent arguments liken=
.