-
Notifications
You must be signed in to change notification settings - Fork 468
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
bigint tests running/failing on earlier Node.js versions #349
Comments
I don't see a quick/easy way to just make the bigint tests to build/run on 11.x or later where they exist. I think we should turn off the bigint tests, for the next few days until we can figure out how to only have them run in the right versions? Any objections ? |
Looks like also run ok on 10.x as well, but fail to build on 8.x and 6.x |
I think we'll need to figure out how to guard which tests build/run by supported napi version. I think we've not run into this before because so far pretty much everything used by node-addon-api has been available in all versions. |
@mhdawson sounds okay. fwiw i don't really know how your versioning system works so you do you. |
I can confirm that the problems are only for Node.js version 6.x and 8.x. |
We have the problem also for |
I worked a little on this issue and the only way I thought is to dynamically create the following files:
It's something like a pre-test process where we need to execute the following steps:
We can do that creating a file where to specify the test we want execute on the specific version of Node.js like reported below: {
6: [
// List of test for Node.js 6
],
8: [
// List of test for Node.js 8
]
// ...
} For now this is my idea maybe there is a better way. |
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 Fixes: nodejs#349
`npm test` command has been failed in old version node.js since introducing `bitint` tests. The problem is caused that old version V8 doesn't support the bigint syntax(e.g. 11n, 22n). So, we just wrap the syntax using `eval()` method to avoid the problem. /home/jinho_bang/up/test/typedarray.js:81 t[3] = 11n; ^^ SyntaxError: Invalid or unexpected token at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at testModules.forEach.name (/home/jinho_bang/up/test/index.js:54:5) Fixes: nodejs#349
`npm test` command has been failed in old version node.js since introducing `bitint` tests. The problem is caused that old version V8 doesn't support the bigint syntax(e.g. 11n, 22n). So, we just wrap the syntax using `eval()` method to avoid the problem. /home/jinho_bang/up/test/typedarray.js:81 t[3] = 11n; ^^ SyntaxError: Invalid or unexpected token at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at testModules.forEach.name (/home/jinho_bang/up/test/index.js:54:5) Fixes: nodejs#349
Should be fixed by #350 |
FYI, All CI runs have now completed and were good on my branch. |
@mhdawson I downloaded your work from https://github.com/mhdawson/node-addon-api/tree/fixci-bigint and tried to execute the test but I get an error like reported below: I'm working on Node.js version8.12.0 and macOs 10.13.6. Maybe the problem is in nvm because i'm using it to switch between different version of Node.js. |
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 PR-URL: #350 Fixes: #349 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jinho Bang <zino@chromium.org>
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 PR-URL: nodejs/node-addon-api#350 Fixes: nodejs/node-addon-api#349 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jinho Bang <zino@chromium.org>
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 PR-URL: nodejs/node-addon-api#350 Fixes: nodejs/node-addon-api#349 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jinho Bang <zino@chromium.org>
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 PR-URL: nodejs/node-addon-api#350 Fixes: nodejs/node-addon-api#349 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jinho Bang <zino@chromium.org>
Add the ability to specify a NAPI_VERSION which limits the tests executed to those supported by that version. As an example tests can be built/run as: npm test --NAPI_VERSION=3 PR-URL: nodejs/node-addon-api#350 Fixes: nodejs/node-addon-api#349 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jinho Bang <zino@chromium.org>
The CI is broken for Node.js versions lower than master because the bigint tests are running even though the methods don't exist in those earlier versions.
We need to guard execution of those tests to only run on 11.x and later.
The text was updated successfully, but these errors were encountered: