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: skip test when native module is not available #170

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

richardlau
Copy link
Member

Skip test/hook/v14-native-modules.mjs when no native module is available for the platform.


The @node-rs/crc32-* module that the test uses isn't available on all os-arch combinations.

First noticed in citgm runs, e.g. https://ci.nodejs.org/job/citgm-smoker/nodes=rhel8-s390x/3520/testReport/junit/(root)/citgm/import_in_the_middle_v1_11_3/

 not ok 30 test/hook/v14-native-modules.mjs
   ---
   stdout: ''
   stderr: >-
     node:internal/modules/run_main:104
         triggerUncaughtException(
         ^
     Error: Cannot find module
     '/home/iojs/tmp/citgm_tmp/7285591d-3030-4e14-904d-0a9c0040c0a7/import-in-the-middle/test/fixtures/native-modules/linux-s390x.js'
     imported from
     /home/iojs/tmp/citgm_tmp/7285591d-3030-4e14-904d-0a9c0040c0a7/import-in-the-middle/test/hook/v14-native-modules.mjs
         at finalizeResolution (node:internal/modules/esm/resolve:275:11)
         at moduleResolve (node:internal/modules/esm/resolve:860:10)
         at defaultResolve (node:internal/modules/esm/resolve:984:11)
         at nextResolve (node:internal/modules/esm/hooks:748:28)
         at resolve (/home/iojs/tmp/citgm_tmp/7285591d-3030-4e14-904d-0a9c0040c0a7/import-in-the-middle/hook.js:322:26)
         at nextResolve (node:internal/modules/esm/hooks:748:28)
         at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
         at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24)
         at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
         at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28) {
       code: 'ERR_MODULE_NOT_FOUND',
       url: 'file:///home/iojs/tmp/citgm_tmp/7285591d-3030-4e14-904d-0a9c0040c0a7/import-in-the-middle/test/fixtures/native-modules/linux-s390x.js'
     }
     Node.js v24.0.0-pre
   ...

Skip `test/hook/v14-native-modules.mjs` when no native module is
available for the platform.
Copy link
Contributor

@timfish timfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@timfish timfish requested a review from jsumners-nr December 13, 2024 16:21
@timfish timfish changed the title fix: skip test when native module is not available test: skip test when native module is not available Dec 13, 2024
@timfish timfish merged commit 23ac083 into nodejs:main Dec 13, 2024
47 of 48 checks passed
@richardlau richardlau deleted the missing-bindings branch December 13, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants