Skip to content
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

make test-npm in LTS (4.4.3) #6220

Closed
richardlau opened this issue Apr 15, 2016 · 20 comments
Closed

make test-npm in LTS (4.4.3) #6220

richardlau opened this issue Apr 15, 2016 · 20 comments
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. test Issues and PRs related to the tests.

Comments

@richardlau
Copy link
Member

richardlau commented Apr 15, 2016

  • Version: v4.4.3
  • Platform: Linux drv-aeon 2.6.32-131.12.1.el6.x86_64 deps: update openssl to 1.0.1j #1 SMP Sun Jul 31 16:44:56 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: test

make test-npm appears to be broken in LTS (v4.4.3):

I saw #6150 contains a patch to remove the call to test-legacy, so I've applied that patch and now get a different error:

This looks like the test is looking for npm -- Presumably the makefile or tools/test-npm.sh should be adding npm to the path?

I've tried adding test-npm/bin to my PATH, which results in yet another error:

This looks like test-npm/bin/npm is incorrectly resolving npm-cli.js -- I think test-npm/bin/npm is written for an installed Node (i.e. expecting npm to live under a node_modules directory) and not the copy made for the test.

@richardlau
Copy link
Member Author

CC @zkat

@mscdex mscdex added test Issues and PRs related to the tests. npm Issues and PRs related to the npm client dependency or the npm registry. v4.x labels Apr 15, 2016
@MylesBorins
Copy link
Contributor

@richardlau this is my bad. It looks like it is the result of the recent upgrade to npm v2.15.1

This is now fixed in v4.x-staging

Thank you for pointing this out!

@MylesBorins
Copy link
Contributor

it is worth mentioning that make test-npm is now working as expected on v4.x-staging

@richardlau
Copy link
Member Author

@thealphanerd Nope, still fails for me with v4.x-staging

@richardlau
Copy link
Member Author

-bash-4.1$ git describe
v4.4.3-6-gc92febf
-bash-4.1$

@MylesBorins
Copy link
Contributor

MylesBorins commented Apr 15, 2016 via email

@richardlau
Copy link
Member Author

Is this documented anywhere?

@richardlau
Copy link
Member Author

(No I wasn't running make install first, there wasn't anything suggesting I needed to do that)

@mhdawson
Copy link
Member

mhdawson commented Apr 15, 2016

There was earlier issues with this:

#1926

and I believe we were trying to ensure it could continue to run without having to install node globally

@MylesBorins
Copy link
Contributor

I've sent a PR to update the docs

#6231

@mhdawson
Copy link
Member

Reopening for discussion as to whether it should required a global install

@mhdawson mhdawson reopened this Apr 15, 2016
@mhdawson
Copy link
Member

mhdawson commented Apr 15, 2016

From my perspective requiring a global install is not that friendly. I'd want people to be able to easily run the tests without having to affect their environment outside of the tree they are compiling Node in. And there was some prior agreement on that so we should discuss.

@Fishrock123
Copy link
Contributor

There's not much to discuss here. That is the state of things in npm 2 and fixing it isn't super trivial iirc.

Besides, most people aren't going to be running those tests, and we're adding a doc note about it.

@Fishrock123
Copy link
Contributor

Note that this works as expected on master with npm 3.

@MylesBorins
Copy link
Contributor

@mhdawson #1926 was never backported to v4.x

So here is package.json for npm in v4.4.1 which we are aware of working in CI

"test-tap": "npm run tap -- \"test/tap/*.js\""

as you can see it calls to npm expecting it in the path. Nothing has changed here between v4.4.1 and v4.4.3

Alternatively on master we can see that npm 3 is a bit smarter about setting up the env

https://github.com/nodejs/node/blob/master/deps/npm/package.json#L210

@mhdawson
Copy link
Member

Ok so I can understand "its already fixed in later versions" and was always broken in post 0.12.X so we won't fix the versions in the middle.

In that case I expect Richard's problem is unrelated to have to do the global install as the tests were running ok until 4.4.2

@Fishrock123
Copy link
Contributor

Fishrock123 commented Apr 24, 2016

Iirc even with our tools fix, npm will create child processes on a global node.

(Note: I may be incorrect on that, and anyone is welcome to investigate!)

@addaleax
Copy link
Member

@Fishrock123 As of npm/npm#11204, npm will spawn its script child processes with the Node.js version it was invoked with by adding the directory in which process.execPath resides to the PATH.
According to the PR’s milestones, that’s npm >= 3.7.0 and >= 2.14.17, which have been bundled with Node.js >= 5.8.0 and >= 4.4.0 respectively… I’ve done a ton of digging on issues that were related to that change.

@mhdawson
Copy link
Member

@addaleax so if I read your statement correctly if the npm in the build tree was used then the child processes would be as well, right ?

@addaleax
Copy link
Member

@mhdawson I think so, yes. I’m definitely not an expert for the Node core side of npm testing, but the corresponding line to that change is there in v4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

6 participants