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

test: enable addons test to pass with debug build #8836

Closed
wants to merge 4 commits into from

Conversation

Projects
None yet
10 participants
@danbev
Copy link
Member

commented Sep 28, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected 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.

test: enable addons test to pass with debug build
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.
@danbev

This comment has been minimized.

Copy link
Member Author

commented Sep 28, 2016

@mscdex mscdex added the addons label Sep 28, 2016

@addaleax
Copy link
Member

left a comment

LGTM and thank you!! :)

@cjihrig
Copy link
Contributor

left a comment

Saw this the other day and meant to LGTM it. Sorry for missing it. LGTM, and the CI seems reasonably happy.

@jasnell
Copy link
Member

left a comment

LGTM

@lpinca

lpinca approved these changes Oct 1, 2016

Copy link
Member

left a comment

LGTM

update addons.md to consider the build type
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.
@danbev

This comment has been minimized.

Copy link
Member Author

commented Oct 1, 2016

Another CI run as I completely missed the paths in addons.md:
https://ci.nodejs.org/job/node-test-pull-request/4352/

@imyller

imyller approved these changes Oct 2, 2016

Copy link
Member

left a comment

LGTM

@imyller

This comment has been minimized.

@danbev

This comment has been minimized.

Copy link
Member Author

commented Oct 3, 2016

@addaleax @cjihrig @jasnell @lpinca I just wanted to check if your LGTM still stands with the lastest commit, as I made it afterwards.

@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Oct 3, 2016

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.

@addaleax

This comment has been minimized.

Copy link
Member

commented Oct 3, 2016

@danbev Could the addons.md modifications also be accomplished by modifying the wrapper in tools/doc/addon-verify.js? If so, I think I’d prefer that when compared to using process.config in the docs itself.

@danbev

This comment has been minimized.

Copy link
Member Author

commented Oct 4, 2016

I assume you made the change because node-gyp defaults to the build mode of the node binary?

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 don't think the change to addon.md is a good one.

I can take a shot tonight at adding this to tools/doc/addon-verify.js, like @addaleax suggested, as that would leave addons.md unchanged. Or let me know if there is a better option here that I might not have understood?

@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Oct 4, 2016

The issue I was trying to work around was that the generated tests assume the the build is of type Release

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.

@danbev

This comment has been minimized.

Copy link
Member Author

commented Oct 4, 2016

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

@danbev

This comment has been minimized.

Copy link
Member Author

commented Oct 4, 2016

@bnoordhuis
Copy link
Member

left a comment

LGTM, thanks.

@addaleax
Copy link
Member

left a comment

Thanks for updating this, still LGTM!

@imyller

This comment has been minimized.

Copy link
Member

commented Oct 5, 2016

@jasnell

This comment has been minimized.

Copy link
Member

commented Oct 6, 2016

CI failures look unrelated.

jasnell added a commit that referenced this pull request Oct 6, 2016

test: enable addons test to pass with debug build
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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@jasnell

This comment has been minimized.

Copy link
Member

commented Oct 6, 2016

Landed in fdca79f

@jasnell jasnell closed this Oct 6, 2016

jasnell added a commit that referenced this pull request Oct 6, 2016

test: enable addons test to pass with debug build
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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins

This comment has been minimized.

Copy link
Member

commented Oct 6, 2016

lts?

@jasnell

This comment has been minimized.

Copy link
Member

commented Oct 7, 2016

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.

Fishrock123 added a commit that referenced this pull request Oct 11, 2016

test: enable addons test to pass with debug build
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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins

This comment has been minimized.

Copy link
Member

commented Nov 18, 2016

@jasnell it is not landing cleanly but the diff is something like 2 lines... might be worth doing manually if you have the bandwidth

MylesBorins added a commit that referenced this pull request Dec 20, 2016

test: enable addons test to pass with debug build
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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 21, 2016

test: enable addons test to pass with debug build
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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

@MylesBorins MylesBorins referenced this pull request Dec 21, 2016

Merged

V4.7.1 proposal #10395

@danbev danbev deleted the danbev:fix-debug-testing branch Jan 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.