-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: fix test-esm-addons #16174
test: fix test-esm-addons #16174
Conversation
Assuming no CI surprises, would love to see this fast-tracked to get CI back to yellow/green. @guybedford @refack @bmeck @danbev @nodejs/testing |
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 anyway
test/addons/hello-world-esm/test.mjs
Outdated
/* eslint-disable required-modules */ | ||
|
||
import assert from 'assert'; | ||
import binding from '../addons/hello-world/build/Release/binding.node'; | ||
import binding from './build/Release/binding.node'; |
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.
This still uses build/Release
… did you verify that this fixes #16155?
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.
Whoops, I'll fix that. (No, I didn't verify. In my defense, I said "should now work in Debug builds" rather than "definitely does now work in Debug builds". :-D )
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.
Fixed! Should now work in Debug builds for really realz, although I haven't verified.
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
3ae9e0f
to
e32a9fe
Compare
I haven't verified that this fix makes the test pass on Debug builds, so if anyone verifies that, it would be awesome if you could leave a note here. |
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.
Yup, LGTM & I’ll try this out in a debug build later
const buildDir = join(__dirname, 'build'); | ||
|
||
copyFileSync(join(buildDir, common.buildType, 'binding.node'), | ||
join(buildDir, 'binding.node')); |
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.
We should maybe just do this (or, on POSIX, do symlinks) for all addons.
CI is showing green, but no tests were actually run. Something is not working on CI. Will have to run again after it's fixed. |
Debug build worked for me 👍 |
CI seems to be working now. |
Linux had an unrelated failure so I re-ran and its green: https://ci.nodejs.org/job/node-test-commit-linux/13135/ Everything else is green the first time including those Raspberry Pi devices that were failing on this test before. I'm going to sleep, but if someone feels that this is worth fast-tracking, you certainly have my endorsement to land it. :-D |
Thanks so much for this fix, and apologies - it completely slipped my mind to find a more portable approach here. Just caught this now due to time zones, but looks great to me! |
K.I.S.S. FTW. I got stuck in my own head trying to find an elegant solution for Lines 149 to 166 in 668f4cf
|
@Trott I'm thinking maybe duplicating a whole addon just for this test is too expensive... Any thoughts? |
I prefer it as a separate unit with no dependencies on other tests, but I wouldn't oppose a subsequent refactoring that reduced that duplication if that's bothering you or anyone else. I'm thinking this should land as-is to get the CI to not-red as soon as possible. |
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#16174 Fixes: nodejs#16155 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Landed in 981595c. I thought I saw someone else give a thumbs-up to fast-tracking, but now I don't see it. Apologies if this went too fast... |
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 <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Move test-esm-addons to test/addons/hello-world-esm.
Test should now work properly on CI machines where
addons
are notalways built at the expected relative path from the es-modules tests.
Test should now work in Debug builds.
Fixes: #16155
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test