-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
doc: make test commands a little more consistent #19919
Comments
+1 I got caught by this on my first contribution and it was painfully slow to the point I was reconsidering whether to contribute at all. It looks like it's been discussed a couple of times before: #8286, #8678, #9961, #9881, #12437. My vote would be a sensible default such as Happy to help with the updates once a consensus is reached. |
cc @nodejs/build @nodejs/documentation |
Seems like a good change. Added labels. |
So the suggestion is that we change We did standardize on So a PR that adds a |
@gibfahn I was thinking somewhere along the lines of doing a repository-wide search for Because sometimes someone might need just |
The PR I referenced above (#9961) did exactly that, it used
I think we just need to add I don't think we should add the "This is what |
Agreed. If it's there in BUILDING.md, people will find it anyway. |
I did a bit of analysis on this ⬇️and I'm wondering if it might be better to promote the use of e.g.
This has the same performance boost, applies to all subsequent I'm certainly no make expert so not sure if there are any drawbacks to this vs. the more explicit approach? ... ℹ️ I extended the search to Note also, as a nit, there is inconsistent use of the |
I'm in favor of explicitly using the |
Fwiw, I remember believing otherwise first, until @Trott told me that that’s what really happens – I would be okay with changing that, but for now, |
Oh, right, I think |
Yes but wouldn't the build be the bigger problem here? It's painfully slow with |
It's definitely slow. Presumably any build prerequisites would run in single job mode with |
Maybe it should be this? make -j`node -p os.cpus\(\).length` test I'm kidding. Maybe. |
Can I take this? I plan to make a small, docs-only change to |
It's even more messy than that @Trott .. this is something I'd like to see fixed up because it's a mess in CI already. You can
So, what we tend to do in CI is be explicit about it, with something like: if [ -z ${JOBS+x} ]; then
JOBS=$(getconf _NPROCESSORS_ONLN) #reported cores, kind of like `os.cpus().length`
fi
JOBS=$JOBS make test-ci -j $JOBS And in some configurations we explicitly set a My wish is that I don't think this helps this discussion but it's worth being aware of this behaviour if you're tinkering in this area. |
That's right, make treats (There are reasons for that, it lets the supervisor control parallelism in nested invocations.) |
I created a separate issue for this: #20065 |
Specifically, fix the inconsistency where the documentation suggests running "$ make test" instead of "$ make -j4 test". The "-j4" flag uses multiple processes, making the command faster. Fixes: #19919 PR-URL: #20091 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
In the
PULL_REQUEST_TEMPLATE.md
file, we ask contributors (who are now submitting a PR) to test the codebase using the commandmake -j4 test
, employing 4 jobs. (https://github.com/nodejs/node/blob/master/.github/PULL_REQUEST_TEMPLATE.md#checklist)On the other hand, the
BUILDING.md
file, we usemake test
only, which uses a single job, IIRC. (https://github.com/nodejs/node/blob/master/BUILDING.md#running-tests)This might not be a major issue per-se, but we could make it more consistent.
The text was updated successfully, but these errors were encountered: