-
Notifications
You must be signed in to change notification settings - Fork 465
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
ci: enable travis for fast PR check #534
Conversation
test/bigint.cc
Outdated
@@ -1,4 +1,3 @@ | |||
#define NAPI_EXPERIMENTAL |
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.
I think this will cause the tests not to run due to this later check #if (NAPI_VERSION > 2147483646)
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.
🤔 maybe an option to control whether NAPI_EXPERIMENTAL
should be defined or not might be needed.
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.
If I remember correctly we had it enabled by default so that we'd run the tests in the most common use case (running on master) and then then CI sets the env variable so that the tests don't run when they run on earlier node version (ex Node.js v8)
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.
But if NAPI_EXPERIMENTAL
is defined the binding.node would mark napi_bigint related symbol as required, which should probably fail on Node.js v8, which I found on travis builds.
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.
I noticed npm_config_NAPI_VERSION
in test/index.js
which would disable bigint tests. AFAIKT, it doesn't affect compilation right? Then requiring binding.node would fail on Node versions that don't have bigint NAPIs.
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.
https://travis-ci.com/legendecas/node-addon-api/builds/125931273
Used node major version to determine if experimental tests should be ran.
In Node.js v8 bigint tests were ignored.
In Node.js v10 bigint tests were ran.
f81685d
to
8415aef
Compare
@mhdawson hi, just updated the PR to use |
test/index.js
Outdated
@@ -45,8 +47,10 @@ let testModules = [ | |||
'version_management' | |||
]; | |||
|
|||
if ((process.env.npm_config_NAPI_VERSION !== undefined) && | |||
(process.env.npm_config_NAPI_VERSION < 50000)) { | |||
const napiVersion = Number(process.env.npm_config_NAPI_VERSION || process.versions.napi); |
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.
I think this will still disable testing the experimental tests by default right? I think we want to make sure that if you just do a checkout that they will run unless you specifically do something to prevent that. Otherwise It will be too easy for us to miss running the experimental tests when we land PRs. Previously if npm_config_NAPI_VERSION was not set then all tests would run, afterwards the experimental tests will never run unless npm_config_NAPI_VERSION is set to run then....
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.
yeah, I noticed that with your mention.
Also I found out that napi_date related API was landed on Node.js v12 as experimental yet NAPI v5 on master. And bigint related API was landed on Node.js v8, v10, v12 and master as experimental. It might be not enough to control experimental features merely by NAPI_VERSION if we'd like to address failure of old Node.js version running node-addon-api tests locally with simple npm test
.
So maybe NAPI_EXPERIMENTAL features should be filtered with Node.js major version.
Nevertheless, I'd like to submit another PR to address this issue. For this PR, we could enable travis for fast PR test check?
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.
Seems reasonable to me. Will wait until Monday to see if we have any other comments, otherwise will land.
49887b2
to
e985975
Compare
1. node-chakracore v8 doesn’t expose napi version 2. node-chakracore v10 doesn’t throws on handlescope double escape 3. set npm_config_NAPI_VERSION to override NAPI_EXPERIMENTAL expansion on Node.js version lower than 11 for napi_date_* not back ported to v10
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
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
Landed as 5d6aeae |
https://github.com/nodejs/node-addon-api/pulls?q=is%3Apr+is%3Aclosed remove the EXPERIMENATAL define. This messed up some of the testing. Adding back until we investigate why.
test: remove unnecessary NAPI_EXPERIMENTAL
As ci.nodejs.org doesn't automatically run for PRs, travis is still the easiest way to determine if the PR is test passed on multiple node variants and platforms.
travis: remove chakracore on travis
on Node.js version lower than 11 for napi_date_* not back ported to v10