Skip to content

Conversation

@danbev
Copy link
Contributor

Currently, when configuring --without-ssl any tests that use
process.binding('crypto') will not report a lint warning. This is
because the eslint check only generates a warning when using require.

This commit adds a check for using binding in addition to require.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tools

Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require.
Currently, when configured --without-ssl this test fails with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check.
Currently, when configured --without-ssl test-repl-tab-complete fails with the following error: assert.js:43 throw new errors.AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30) This commit attempts to fix this test but I'm not sure if this is a proper fix as I'm not familiar with the repl code base yet.
@nodejs-github-botnodejs-github-bot added the tools Issues and PRs related to the tools directory. label Dec 26, 2017
@danbev
Copy link
ContributorAuthor

@danbev
Copy link
ContributorAuthor

constcommon=require('../common');

if(!common.hasCrypto)
common.skip('missing crypto');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than skipping this entire test, can we move the crypto stuff to its if block and only run those tests if hasCrypto is true? This way, we aren't skipping the non-crypto tests in the file.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll do that.

@Trott
Copy link
Member

Does our http2 implementation require OpenSSL? If we compile without OpenSSL, does process.binding('http2') fail or merely return different results than with OpenSSL? @nodejs/http2

constquery=`lexical${type[0]}`;
constexpected=hasInspector ? [[`lexical${type}`],query] : [];
constexpected=hasInspector ? [[`lexical${type}`],query] :
[[],`lexical${type[0]}`];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it is related. Without this I get the error mentioned in the commit:

assert.js:43 throw new errors.AssertionError(obj); ^AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30)

@jasnell
Copy link
Member

process.binding('http2') is still present without openssl but require('http2') is not

@Trott
Copy link
Member

process.binding('http2') is still present without openssl but require('http2') is not

If I'm understanding correctly, then perhaps in some or even all cases, instead of skipping tests that include process.binding('http2') when the node binary is compiled without OpenSSL, perhaps the expected results of the test need to be modified based on the value of common.hasCrypto.

@jasnell
Copy link
Member

It's better to just skip all http2 tests when openssl is not present

@danbev
Copy link
ContributorAuthor

@Trott
Copy link
Member

It's better to just skip all http2 tests when openssl is not present

@jasnell Is that because there is no expected behavior without OpenSSL other than "absolutely nothing whatsoever in http2 works at all"? Or is there a different reason?

@jasnell
Copy link
Member

It's because I'm likely going to change it so that process.binding('http2') doesn't exist if openssl isn't enabled.

Copy link
Member

@BridgeARBridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion, so LGTM

@danbev
Copy link
ContributorAuthor

test/node-test-commit failure looks unrelated

console output:

g++: internal compiler error: Killed (program cc1plus)Please submit a full bug report,with preprocessed source if appropriate.See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.deps/v8/src/v8_base.target.mk:608: recipe for target '/home/iojs/build/workspace/node-test-commit-arm/nodes/ubuntu1604-arm64_odroid_c2/out/Release/obj.target/v8_base/deps/v8/src/objects.o' failedmake[2]: *** [/home/iojs/build/workspace/node-test-commit-arm/nodes/ubuntu1604-arm64_odroid_c2/out/Release/obj.target/v8_base/deps/v8/src/objects.o] Error 4make[2]: *** Waiting for unfinished jobs....rm fa4b5595818ee3c6b8e353e33594a7e9a94ec498.intermediateMakefile:87: recipe for target 'node' failedmake[1]: *** [node] Error 2Makefile:611: recipe for target 'build-ci' failedmake: *** [build-ci] Error 2Build step 'Conditional steps (multiple)' marked build as failureRun condition [Always] enabling perform for step [[]]TAP Reports Processing: STARTLooking for TAP results report in workspace using pattern: *.tapDid not find any matching files. Setting build result to FAILURE.Checking ^not okJenkins Text Finder: File set '*.tap' is emptyNotifying upstream projects of job completionFinished: FAILURE

danbev added a commit that referenced this pull request Dec 29, 2017
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
danbev added a commit that referenced this pull request Dec 29, 2017
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
danbev added a commit that referenced this pull request Dec 29, 2017
Currently, when configured --without-ssl test-repl-tab-complete fails with the following error: assert.js:43 throw new errors.AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30) This commit attempts to fix this test but I'm not sure if this is a proper fix as I'm not familiar with the repl code base yet. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@danbev
Copy link
ContributorAuthor

Landed in 4117e22, 6fc9c33, and acbe007.

@danbevdanbev closed this Dec 29, 2017
@danbevdanbev deleted the eslint-crypto-binding-check branch December 29, 2017 05:35
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
Currently, when configured --without-ssl test-repl-tab-complete fails with the following error: assert.js:43 throw new errors.AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30) This commit attempts to fix this test but I'm not sure if this is a proper fix as I'm not familiar with the repl code base yet. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
Currently, when configured --without-ssl test-repl-tab-complete fails with the following error: assert.js:43 throw new errors.AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30) This commit attempts to fix this test but I'm not sure if this is a proper fix as I'm not familiar with the repl code base yet. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorins
Copy link
Contributor

This will need to be manually backported as it is breaking v9.x-staging

MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Jan 10, 2018
@gibfahn
Copy link
Member

@MylesBorins did you end up getting this to work in 9.x?

@MylesBorins
Copy link
Contributor

@gibfahn it would seem so!

@danbev should this be backported to v6.x or v8.x?

danbev added a commit to danbev/node that referenced this pull request Feb 27, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: nodejs#17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
addaleax pushed a commit to addaleax/node that referenced this pull request Mar 5, 2018
Currently, when configured --without-ssl test-repl-tab-complete fails with the following error: assert.js:43 throw new errors.AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: [ [], 'lexicalL' ] deepStrictEqual [] at testRepl.complete.common.mustCall (node/test/parallel/test-repl-tab-complete.js:549:14) at /node/test/common/index.js:530:15 at completionGroupsLoaded (repl.js:1204:5) at REPLServer.complete (repl.js:1090:11) at REPLServer.completer (repl.js:450:14) at REPLServer.complete (repl.js:919:18) at __dirname.forEach (parallel/test-repl-tab-complete.js:548:14) at Array.forEach (<anonymous>) at Object.<anonymous> (parallel/test-repl-tab-complete.js:545:29) at Module._compile (module.js:660:30) This commit attempts to fix this test but I'm not sure if this is a proper fix as I'm not familiar with the repl code base yet. PR-URL: nodejs#17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Mar 6, 2018
MylesBorins pushed a commit that referenced this pull request Mar 21, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 28, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2018
Currently, when configuring --without-ssl any tests that use process.binding('crypto') will not report a lint warning. This is because the eslint check only generates a warning when using require. This commit adds a check for using binding in addition to require. PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request May 1, 2018
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. PR-URL: nodejs#17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 2, 2018
Currently, when configured --without-ssl tests that use process.binding('crypto') fail with the following error: === release test-accessor-properties === Path: parallel/test-accessor-properties node/test/parallel/test-accessor-properties.js:16 const crypto = process.binding('crypto'); ^ Error: No such module: crypto at Object.<anonymous> (test-accessor-properties.js:16:24) at Module._compile (module.js:660:30) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:577:32) at tryModuleLoad (module.js:517:12) at Function.Module._load (module.js:509:3) at Function.Module.runMain (module.js:701:10) at startup (bootstrap_node.js:194:16) at bootstrap_node.js:645:3 This commit adds a hasCrypto check. Backport-PR-URL: #20456 PR-URL: #17867 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request May 2, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@danbev@Trott@jasnell@MylesBorins@gibfahn@BridgeAR@nodejs-github-bot