nodejs / js-native-api-test

Node.js js-native-api-test suite, externalized so that it can be used to test Node-API implementations outside of Node.js
MIT License
7 stars 10 forks source link

Discussion on bootstrapping NTS project #2

Open yorkie opened 5 years ago

yorkie commented 5 years ago

Hi @nodejs/n-api, before drafting the first version of the N-API test suite, I think we have the following issues to address.

Questions collection

My proposal

When the test suite is completely moved inside this repository, how to integrate it in Node.js?

For example, a bugfix on current implementation on Node.js itself is submitted on our main repository nodejs/node, the test suite needs to be merged on nodejs/napi-test-suite as a precondition, this seems a little verbose to contributors.

A suggestion is to keep the latest test suite for N-API still on Node.js, and archives tests when releasing a Node.js version. Archives tests means:

When the test suite is completely moved inside this repository, how to integrate it for other runtimes, is it consistent with Node.js?

When the above proposal is accepted and complete, the others only needs to use npm install by a specific version, and run these tests by themselves. And there is no necessary to use this in Node.js, too, this is for Node.js-like runtimes only.

What's the rule to sync N-API tests before this move is complete?

When the above proposal is accepted and complete, we could skip this problem as well.

/cc @gabrielschulhof @mhdawson

mhdawson commented 5 years ago

I think the first step is to figure out how to copy the tests in Node.js to this repo on a regular basis.

ie. keep the test suite bundled into the core Node.js repo, but figure out how to create a separate copy from that suite on a regular basis.

Once we have that working we should have a better understanding with respect to the linkage between the Node.js runtime and the challenges of having the tests be separate.

yorkie commented 5 years ago

I think the first step is to figure out how to copy the tests in Node.js to this repo on a regular basis.

We have an alternative script to do that: https://github.com/Rokid/ShadowNode/blob/master/tools/pull-napi.sh, which downloads the official tar and unzip to a local dest by the following:

$ sh ./pull-napi.sh v10.10.0

I'm glad to implement this on napi-test-suite if the above proposal LGTY :)

mhdawson commented 5 years ago

@yorkie maybe the first step is to use your script locally and then push the first version of the files to the

napi-test-suite/src

directory

and add directions to the README.md on how to use that source to build/test on Node.js and on shadowNode ?

mhdawson commented 5 years ago

Then next step would then be to add your script to napi-test-suite/tools along with instructions on how to use it to generate an update for the napi-test-suite/src directory.

Does the script also run on linux? I see some checks for OSX, but not sure if you are already running it on linux as well?

yorkie commented 5 years ago

Does the script also run on linux? I see some checks for OSX, but not sure if you are already running it on linux as well?

Maybe we could write this script in Node.js that we could get cross-platform :)

maybe the first step is to use your script locally and then push the first version of the files to the napi-test-suite/src directory

I will make a PR :p

yorkie commented 5 years ago

@mhdawson I have created a PR with N-API tests and headers at #3, please take a review for me, thanks :)