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-esm-addon.mjs fails when building in debug mode #16155

Closed
danbev opened this issue Oct 12, 2017 · 4 comments
Closed

test-esm-addon.mjs fails when building in debug mode #16155

danbev opened this issue Oct 12, 2017 · 4 comments
Labels
addons Issues and PRs related to native addons. esm Issues and PRs related to the ECMAScript Modules implementation. flaky-test Issues and PRs related to the tests with unstable failures on the CI. test Issues and PRs related to the tests.

Comments

@danbev
Copy link
Contributor

danbev commented Oct 12, 2017

  • Version: master
  • Platform: Mac OS X
  • Subsystem: module, test

When building with $ ./configure --debug && make -j8 test the the following error is reported:

=== release test-esm-addon ===
Path: es-module/test-esm-addon
(node:35080) ExperimentalWarning: The ESM module loader is experimental.
Error: module ../addons/hello-world/build/Release/binding.node not found
    at module.exports (internal/loader/search.js:14:12)
    at exports.resolve (internal/loader/ModuleRequest.js:91:13)
    at Loader.resolve (internal/loader/Loader.js:50:40)
    at Loader.getModuleJob (internal/loader/Loader.js:78:40)
    at ModuleWrap.module.link (internal/loader/ModuleJob.js:27:25)
    at linked (internal/loader/ModuleJob.js:25:19)
    at <anonymous>
Command: out/Release/node --experimental-modules /Users/danielbevenius/work/nodejs/node/test/es-module/test-esm-addon.mjs
[02:10|% 100|+ 1983|-   1]: Done
make: *** [test] Error 1

The addon tests use ${common.buildType} to determine the buildType, but it seems that only a string literal is allowed for the import so I'm not sure about a proper way to fix this.

@addaleax addaleax added addons Issues and PRs related to native addons. esm Issues and PRs related to the ECMAScript Modules implementation. test Issues and PRs related to the tests. labels Oct 12, 2017
@Trott
Copy link
Member

Trott commented Oct 12, 2017

@Trott
Copy link
Member

Trott commented Oct 12, 2017

A less-than-fully-satisfying-but-perhaps-effective fix may be to create a wrapper for that checks for the location of binding.node and copies it to a location that is hardcoded in the actual test?

The wrapper could also fix the CI issue linked above in that it could skip the test if it can't find the binding.node file or if it only finds an out-of-date one.

@refack refack added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Oct 12, 2017
@refack
Copy link
Contributor

refack commented Oct 12, 2017

Cross-ref: #15445 (comment)
AFAICT the only robust solution is to move node/test/es-module/test-esm-addon.mjs to test/addons/hello-world/

@Trott Trott mentioned this issue Oct 13, 2017
3 tasks
@Trott
Copy link
Member

Trott commented Oct 13, 2017

Proposed fix in #16174

Trott added a commit to Trott/io.js that referenced this issue Oct 13, 2017
Move test-esm-addons to test/addons/hello-world-esm.

Test should now work properly on CI machines where `addons` are not
always built at the expected relative path from the es-modules tests.

Test should now work in Debug builds.

Fixes: nodejs#16155
@Trott Trott closed this as completed in 981595c Oct 13, 2017
addaleax pushed a commit to ayojs/ayo that referenced this issue Oct 15, 2017
Move test-esm-addons to test/addons/hello-world-esm.

Test should now work properly on CI machines where `addons` are not
always built at the expected relative path from the es-modules tests.

Test should now work in Debug builds.

PR-URL: nodejs/node#16174
Fixes: nodejs/node#16155
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
targos pushed a commit that referenced this issue Oct 18, 2017
Move test-esm-addons to test/addons/hello-world-esm.

Test should now work properly on CI machines where `addons` are not
always built at the expected relative path from the es-modules tests.

Test should now work in Debug builds.

PR-URL: #16174
Fixes: #16155
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. esm Issues and PRs related to the ECMAScript Modules implementation. flaky-test Issues and PRs related to the tests with unstable failures on the CI. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants