test: make tests pass when configured --without-ssl#11631
test: make tests pass when configured --without-ssl#11631danbev wants to merge 8 commits intonodejs:masterfrom
Conversation
abdc101 to
b81bdb2
Compare
|
Rebased and new CI: https://ci.nodejs.org/job/node-test-pull-request/6651/ |
|
parallel/test-https-agent-create-connection is failing on the centos5-32 and win2008r2 buildbots with this PR but not others. EDIT: Although, see #11644 - almost too much of a coincidence. |
test/fixtures/tls-connect.js
Outdated
test/testpy/__init__.py
Outdated
There was a problem hiding this comment.
I'm kind of surprised this works. gyp generally doesn't like it when there are no source files to compile.
test/fixtures/tls-connect.js
Outdated
There was a problem hiding this comment.
Can you fix up the tests that include this file? They call this function too but that's unnecessary with this change. You can probably stop exporting checkCrypto() altogether and just inline it here.
There was a problem hiding this comment.
Ah right, missed that. I'll fix that.
test/testpy/__init__.py
Outdated
There was a problem hiding this comment.
Does this run once per run or once per test? The latter would be a little wasteful.
There was a problem hiding this comment.
It is actually once per test which is wasteful as you say. I'll take a look at how this can be run only once.
test/addons/openssl-binding/test.js
Outdated
There was a problem hiding this comment.
Existing uses of common.skip() in other tests return afterwards rather than calll process.exit().
There was a problem hiding this comment.
I'll take another look at this. Just returning does not work in this case but I'll try and dig a little further.
There was a problem hiding this comment.
In this case I don't think we can just return as that would cause the tests that require tls-connect should not be able to proceed if there is no crypto. There might be other/better ways to deal with this but perhaps that should be done as a separate PR in that case.
c47e103 to
e648edb
Compare
Currently when node is build --without-ssl and the test are run, the test that use the tls-connect fixture will throw an Error saying that Node was not built with ssl support. The error is thrown when the tls module is required causing the test that use it to fail unstead of being skipped when there is no ssl support to test. This commit calls checkCrypto before requiring the tls module so that an error is not thrown and the test skipped instead.
This commit enables the test-parallel target to pass when the build is
configured --without-ssl
To configure and run:
$ ./configure --without-ssl --debug && make -j8 test-parallel
The update to test/testspy/__init__.py is for
test-cluster-inspector-debug-port.js which passes '--inspect={PORT} flag
to the node process which causes the process to exit as the inspector is
not enabled when ssl is disabled. The suggested solution here is to
simply remove the flag when v8_enable_inspector is 0 and then have a
check in the test like the others test in this commit.
Add checks to the compilation of this addon and also a check when the test is run to see if ssl is enabled or not. If it is not enabled then skip this test.
e648edb to
b440006
Compare
|
Rebased and triggered another CI: https://ci.nodejs.org/job/node-test-pull-request/6675/ |
|
@bnoordhuis Would you mind taking a look at the lastest commits which attempt to address your review? |
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM if you update the remaining test files. Nice work.
test/fixtures/tls-connect.js
Outdated
| module.exports = exports = function() { | ||
| return exports; | ||
| } | ||
| }; |
There was a problem hiding this comment.
You can remove this if you update the files that include this file:
$ git grep -n tls-connect test/
test/parallel/test-tls-addca.js:11:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-ca-concat.js:10:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-cert-chains-concat.js:10:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-cert-chains-in-ca.js:10:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-connect-secure-context.js:9:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-peer-certificate.js:9:} = require(join(common.fixturesDir, 'tls-connect'))();
test/parallel/test-tls-socket-default-options.js:10:} = require(join(common.fixturesDir, 'tls-connect'));
Simply remove the () at the end.
There was a problem hiding this comment.
Ah great, was not sure I was "allowed" to do that :) Thanks for the review!
Currently when node is build --without-ssl and the test are run, there are a number of failing test due to tests expecting crypto support to be available. This commit fixes fixes the failure and instead skips the tests that expect crypto to be available. PR-URL: nodejs#11631 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
Landed in 1402fef |
|
This doesn't appear to work properly when cherry-picked to v7.x-staging. This is the error I am getting when trying to run Mind opening a backport PR? |
Currently when node is build --without-ssl and the test are run, there are a number of failing test due to tests expecting crypto support to be available. This commit fixes fixes the failure and instead skips the tests that expect crypto to be available. PR-URL: nodejs#11631 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
Should this be backported to |
|
Probably makes sense to backport #12485 in the same PR. |
|
Also #12882 (and any other later ones that use |
|
@gibfahn Sorry about not replying to the backporting issues/requests. I'm not ignoring them, I'm just a little swamped this week and hope to take a closer look at them next week. |
|
@danbev there's no rush! If it misses the windows for this release you might have to rebase before the next one, but otherwise it doesn't make a big difference. If something really needs to be backported I'll let you know. |
|
I've backported |
|
If we backport the rest of this to v6.x we should include #16621 |
This pull request contains a number of commits to enable the tests to pass when having configured node using
--without-ssl. For example:Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test