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: n-api/addons test change issues #13521

Closed
mscdex opened this issue Jun 7, 2017 · 13 comments
Closed

test: n-api/addons test change issues #13521

mscdex opened this issue Jun 7, 2017 · 13 comments
Labels
addons Issues and PRs related to native addons. node-api Issues and PRs related to the Node-API. question Issues that look for answers. test Issues and PRs related to the tests.

Comments

@mscdex
Copy link
Contributor

mscdex commented Jun 7, 2017

  • Version: master, v8.x
  • Platform: n/a
  • Subsystem: n-api, test

Is there supposed to be a way to correctly "fix" n-api/addon tests when those tests change? Today was the second time in the past few days I've ran into issues like this:

Building addon /home/mscdex/git/node/test/addons-napi/test_napi_status/
gyp: binding.gyp not found (cwd: /home/mscdex/git/node/test/addons-napi/test_napi_status) while trying to load binding.gyp
Makefile:288: recipe for target 'test/addons-napi/.buildstamp' failed
make[1]: *** [test/addons-napi/.buildstamp] Error 1
Makefile:196: recipe for target 'test' failed
make: *** [test] Error 2

or this (which I originally got earlier today):

=== release testNapiStatus ===                                                 
Path: addons-napi/test_general/testNapiStatus
/home/mscdex/git/node/test/addons-napi/test_general/testNapiStatus.js:7
addon.createNapiError();
      ^

TypeError: addon.createNapiError is not a function
    at Object.<anonymous> (/home/mscdex/git/node/test/addons-napi/test_general/testNapiStatus.js:7:7)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Performing a make test-addons-clean did not fix the problem. Is there something else we should be doing (in general)?

/cc @nodejs/n-api @nodejs/build

@mscdex mscdex added addons Issues and PRs related to native addons. node-api Issues and PRs related to the Node-API. question Issues that look for answers. test Issues and PRs related to the tests. labels Jun 7, 2017
@addaleax
Copy link
Member

addaleax commented Jun 7, 2017

There’s an extra target make test-addons-napi-clean, does that help?

@mscdex
Copy link
Contributor Author

mscdex commented Jun 7, 2017

@addaleax The test-addons-clean target already calls that target as its last step.

@mhdawson
Copy link
Member

mhdawson commented Jun 7, 2017

The clean must not remove the dynamically built contents from the addon subdirectories directories. I wonder if this is specific to n-api or just that they are changing more often than the non n-api ones.

@mhdawson
Copy link
Member

mhdawson commented Jun 7, 2017

Looking at the issue it may be more that after a pull, that pull is not deleting directories that were removed and therefore the test still tries to run.

@mscdex
Copy link
Contributor Author

mscdex commented Jun 7, 2017

@mhdawson That was my guess, leftover directories.

@joyeecheung
Copy link
Member

@mhdawson test-addons-clean cleans the dynamically generated directories with $(RM) -r test/addons/??_*/ but there doesn't seem to be a naming pattern for the generated directories of n-api. They can be written out in the Makefile one by one, although that takes a bit more maintenance.

@joyeecheung
Copy link
Member

Ah I understand the comments incorrectly, this is about git pull not deleting the directories...but then those leftover directories should show up in git status output right?

@mscdex
Copy link
Contributor Author

mscdex commented Jun 8, 2017

@joyeecheung Not from what I saw earlier.

@mhdawson
Copy link
Member

mhdawson commented Jun 9, 2017

The errors in the original posts are both related to directories that I had deleted when I consolidated them into other tests to cut down on the number of addons that we have to build each time.

@mhdawson
Copy link
Member

mhdawson commented Jun 9, 2017

I had to manually delete those directories after doing a git pull. What we would need is a way to tell if its a directories that was deleted as opposed to a new one added. Not sure if we can safely do that.

@gibfahn
Copy link
Member

gibfahn commented Jun 9, 2017

but there doesn't seem to be a naming pattern for the generated directories of n-api.

Seems to me that the ideal fix would be to make the generated directories follow a pattern. Then you could use make test-addons-clean. Not sure how easy that would be though.

@mhdawson
Copy link
Member

mhdawson commented Jun 9, 2017

The directories are not generated, tests are committed to sub-directories and the test automatically scans/runs tests in those directories

@Trott
Copy link
Member

Trott commented Aug 7, 2017

Do we have a proposed solution for this? I'm guessing we don't want to run git commands from the Makefile, but if that's not a code smell, then we could do that I suppose... git clean -fX test/addons-napi or something like that. (Haven't tested it myself.)

addaleax added a commit to addaleax/node that referenced this issue Oct 22, 2017
gibfahn pushed a commit that referenced this issue Oct 30, 2017
The same as #16031 except
for N-API addons.

PR-URL: #16380
Fixes: #13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
gibfahn pushed a commit that referenced this issue Oct 30, 2017
The same as #16031 except
for N-API addons.

PR-URL: #16380
Fixes: #13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
gibfahn pushed a commit that referenced this issue Oct 31, 2017
The same as #16031 except
for N-API addons.

PR-URL: #16380
Fixes: #13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Qard pushed a commit to ayojs/ayo that referenced this issue Nov 2, 2017
The same as nodejs/node#16031 except
for N-API addons.

PR-URL: nodejs/node#16380
Fixes: nodejs/node#13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Qard pushed a commit to ayojs/ayo that referenced this issue Nov 2, 2017
The same as nodejs/node#16031 except
for N-API addons.

PR-URL: nodejs/node#16380
Fixes: nodejs/node#13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
addaleax added a commit to ayojs/ayo that referenced this issue Dec 7, 2017
The same as nodejs/node#16031 except
for N-API addons.

PR-URL: nodejs/node#16380
Fixes: nodejs/node#13521
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. node-api Issues and PRs related to the Node-API. question Issues that look for answers. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants