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

Testing broken on Node.js main branch #1207

Closed
mhdawson opened this issue Sep 20, 2022 · 8 comments
Closed

Testing broken on Node.js main branch #1207

mhdawson opened this issue Sep 20, 2022 · 8 comments

Comments

@mhdawson
Copy link
Member

Fails with:

/home/iojs/build/workspace/node-test-node-addon-api-new/nodes/debian10-x64/node-addon-api/test/index.js:93
process.config.target_defaults.default_configuration =
                                                     ^

TypeError: Cannot assign to read only property 'default_configuration' of object '#<Object>'
    at Object.<anonymous> (/home/iojs/build/workspace/node-test-node-addon-api-new/nodes/debian10-x64/node-addon-api/test/index.js:93:54)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47
@mhdawson
Copy link
Member Author

Likely related to nodejs/node@e0ab8dd

@mhdawson
Copy link
Member Author

This is the code in the test script

process.config.target_defaults.default_configuration =
  fs
    .readdirSync(path.join(__dirname, process.env.REL_BUILD_PATH || '', 'build'))
    .filter((item) => (item === 'Debug' || item === 'Release'))[0];

@mhdawson
Copy link
Member Author

I'm going to remove that code so that the ci tests start running again, that will break the ability to run in debug I think, so I'll leave this issue open until we figure that out.

@mhdawson
Copy link
Member Author

PR #1208 to remove and get ci working again.

@mhdawson
Copy link
Member Author

CI is green again.

@mhdawson
Copy link
Member Author

Places where we read default_configuration

https://github.com/nodejs/node-addon-api/search?q=default_configuration

@mhdawson
Copy link
Member Author

@NickNaso is going to work on doing updates the replace the usage of default_configuration in the existing test files.

Discussion around how to choose.

  • Command line flag (preferred, by default use Release by default)
  • File system check

@NickNaso
Copy link
Member

NickNaso commented Dec 9, 2022

I'm closing the issue because the PR #1226 has been merged.

@NickNaso NickNaso closed this as completed Dec 9, 2022
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

No branches or pull requests

2 participants