-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
test: enable addons test to pass with debug build #8836
Conversation
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug.
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.
LGTM and thank you!! :)
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.
Saw this the other day and meant to LGTM it. Sorry for missing it. LGTM, and the CI seems reasonably happy.
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.
LGTM
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.
LGTM
When running: $ rm test/addons/.docbuildstamp $ make test/addons/.docbuildstamp A numder of JavaScript test files are generated. These have hard codes paths to build/Release/addons. This commit updates these paths to consider the type of build being performed.
Another CI run as I completely missed the paths in addons.md: |
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.
LGTM
I don't think the change to addon.md is a good one. To a third-party add-on, it doesn't matter (much) if node is built in release or debug mode. You can use a debug mode add-on with a release binary and vice versa. I assume you made the change because node-gyp defaults to the build mode of the node binary? That's actually one of the things I like least about node-gyp; it's confusing to users and it frequently does the wrong thing, like when the node binary that is used to build the add-on is not the binary that actually loads the add-on. |
@danbev Could the |
The issue I was trying to work around was that the generated tests assume the the build is of type Release : // hello.js
const addon = require('./build/Release/addon');
console.log(addon.hello()); // 'world' and changing this to Debug would cause those generated test to fail. Hope I did not misunderstand you here, that might have been what you meant. This is the first time I've dealt with addons.md and how things are generated, and think I need to look into this a little closer.
I can take a shot tonight at adding this to |
Yes, that's what I mean. node-gyp looks at process.config, the tests don't. It's okay to update the tests but I'd rather not encumber addon.md with it. |
Ah great, then I'll take a stab at @addaleax suggestion and leave addons.md unchanged. Thanks |
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.
LGTM, thanks.
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.
Thanks for updating this, still LGTM!
CI failures look unrelated. |
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Landed in fdca79f |
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
lts? |
I'd say it's likely low priority but it likely wouldn't hurt if it applies cleanly. I'd mark it as an optional backport if it does not apply clean. |
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
@jasnell it is not landing cleanly but the diff is something like 2 lines... might be worth doing manually if you have the bandwidth |
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: #8836 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
Currently when running configure with the --debug option in combination
with the tests (./configure --debug && make -j8 test) there are a few
addon tests that fail with error messages similar to this:
=== release test ===
Path: addons/load-long-path/test
fs.js:558
return binding.open(pathModule._makeLong(path), stringToFlags(flags),
mode);
^
Error: ENOENT: no such file or directory, open
'/nodejs/node/test/addons/load-long-path/build/Release/binding.node'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.
(/nodejs/node/test/addons/load-long-path/test.js:28:19)
at Module._compile (module.js:560:32)
at Object.Module._extensions..js (module.js:569:10)
at Module.load (module.js:477:32)
at tryModuleLoad (module.js:436:12)
at Function.Module._load (module.js:428:3)
at Module.runMain (module.js:594:10)
at run (bootstrap_node.js:382:7)
Command: out/Release/node
/nodejs/node/test/addons/load-long-path/test.js
This commit allows for the tests to pass even if the configured build
type is of type debug.