| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
These are still correct, right? I'm not too sure how makefile uses this part.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, NODE_EXE is mostly used as build target.
Sorry, something went wrong.
There was a problem hiding this comment.
Aren't we changing directory a few lines up? Thinking this should just be $NODE. Guess it depends on how you pass the binary path.
Sorry, something went wrong.
There was a problem hiding this comment.
It's not ./node because at this point we are inside the test-npm directory. :)
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, you're right
Sorry, something went wrong.
|
I haven't tried it but the change LGTM. |
Sorry, something went wrong.
|
Rebased and updated, tested, can confirm it still works. Unfortunately npm's tests still require a global node for now. ...unless that can be passed via env variable? |
Sorry, something went wrong.
There was a problem hiding this comment.
Actually on second thought this always used the local node to run cli.js anyways because these are relative links.
Still, I think this PR is better practice given our makefile setup.
Sorry, something went wrong.
There was a problem hiding this comment.
see: http://stackoverflow.com/a/9107028/1279026 (related comment linked below in the "get absolute path" part).
Sorry, something went wrong.
There was a problem hiding this comment.
Seems zsh doesn't sport this variable unfortunately. There is an alternative, but I'd rather avoid using shell-specific things, if possible.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, Will revert to using $0
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, what issue were you trying to solve here exactly? Maybe there's an alternative way.
Sorry, something went wrong.
There was a problem hiding this comment.
Nothing really, I just saw it was suggested in the stackoverflow, going to revert to using $0
Sorry, something went wrong.
|
Updated, PTAL. It now creates a local node link and exports it to the used $PATH, this should run the tests using only the local node binary. Will also test on my assigned linux machine. |
Sorry, something went wrong.
There was a problem hiding this comment.
This may be an issue cross-platform.
My OS X ln cannot do relative symlinks (-r), but linux does not appear to like hard links.
Sorry, something went wrong.
|
I wonder if we have other bash-specific things in those test-npm scripts. Could be an explanation for the weird issues I was having with test-npm on zsh. |
Sorry, something went wrong.
|
PTAL: Updated to remove this bit, which I'll PR separately: EDIT: on second thought it is kind of useless without the hack, so I'm re-adding it again. |
Sorry, something went wrong.
There was a problem hiding this comment.
Ok I can confirm this works on both OS X and Linux (Ubuntu 15), it just means we have an extra thing to clean up in the project root, as seen at the bottom of this file.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks like this fails on a more recent npm with these errors:
test/tap/lifecycle-path.js ............................ 2/4
make sure the path is correct
not ok exit code
+++ found
--- wanted
-0
+1
compare: ===
at:
file: test/tap/lifecycle-path.js
line: 55
column: 7
stack: |
test/tap/lifecycle-path.js:55:7
f (node_modules/once/once.js:17:25)
ChildProcess.<anonymous> (test/common-tap.js:56:5)
maybeClose (internal/child_process.js:764:16)
Socket.<anonymous> (internal/child_process.js:319:11)
Pipe._onclose (net.js:467:12)
make sure the path is correct
not ok should be equivalent
+++ found
--- wanted
[
- "{{ROOT}}/bin/node-gyp-bin"
- "{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin"
- "/bin"
- "/usr/bin"
+ "> ./node-bin/node print-path.js"
]
at:
file: test/tap/lifecycle-path.js
line: 74
column: 7
stack: |
test/tap/lifecycle-path.js:74:7
f (node_modules/once/once.js:17:25)
ChildProcess.<anonymous> (test/common-tap.js:56:5)
maybeClose (internal/child_process.js:764:16)
Socket.<anonymous> (internal/child_process.js:319:11)
Pipe._onclose (net.js:467:12)
From this test: https://github.com/npm/npm/blob/master/test/tap/lifecycle-path.js
@othiym23 is this worth the effort to hack this in before npm's tests work without a global node? It seems like this test is relying on the location of the node binary, is that something that can / should be fixed?
Sorry, something went wrong.
|
@silverwind / @jbergstroem ptal again. :) |
Sorry, something went wrong.
|
Anyone able to review? :D |
Sorry, something went wrong.
|
Hmm, getting some failures...not sure if it is related to the most recent changes you made or not though... |
Sorry, something went wrong.
|
@evanlucas what OS? Those look like npm failures. If my script is broken on your system the tests will almost certainly fail to run. :P |
Sorry, something went wrong.
|
Yosemite. Haven't tried running them standalone yet though |
Sorry, something went wrong.
|
Uh oh, the same two tests are failing for me now when rebased on master, but only with this patch? How is that possible... I'll have to investigate. Edit: must have something to do with setting the $PATH. |
Sorry, something went wrong.
There was a problem hiding this comment.
I think the original PATH should be restored after the test run? (Maybe through saving it to a temp var)
Sorry, something went wrong.
There was a problem hiding this comment.
@silverwind you mean after the legacy tests? I could try that.
Sorry, something went wrong.
There was a problem hiding this comment.
I mean having PATH=$PWD:$PATH will prepend the directory on each run of test-npm.sh, resulting in PATH getting longer and longer.
Sorry, something went wrong.
There was a problem hiding this comment.
Hmmm, nope. It appears the tests themselves depend on a global node (from the tap module, I think?)
Since running the test requires it, and causes it to fail, that's not a possibility.
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure you understand what I mean. My issue is with the global shell's PATH being in an modified state after this script finishes executing (global node now pointing to the built one), and I think we should restore PATH after this script is done.
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe just removing the export is sufficient so all child scripts get the correct binary and we avoid touching the global PATH.
Sorry, something went wrong.
|
Updated to remove the $PATH hack. I'll try working on it separately. PTAL please, would like to land this haha. |
Sorry, something went wrong.
|
Looks pretty straightforward now. LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
PR-URL: nodejs#1984 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Roman Reiss <me@silverwind.io>
| Back | FazBrowse Home | New Git URL |
See: #1955 (comment)
cc @nodejs/build