-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: replace common.fixturesDir with common.fixtures module #15810
Conversation
@@ -32,8 +33,8 @@ const errorMessageRegex = | |||
/^Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch$/; | |||
|
|||
const options = { | |||
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), | |||
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) | |||
key: fs.readFileSync(`${fixtures.fixturesDir}/keys/agent1-key.pem`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be using method fixtures.readKey
instead of fs.readFileSync
to get the keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pawelgolda Sure, but fixtures.readKey
also requires an enc
, not sure what to pass in there 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can leave that param out empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I see from the documentation that enc
is indeed optional, so I will actually go ahead and make that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pawelgolda Doing that change breaks the test for some reason..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasimdoctor Can you post the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should definitely just be...
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell I get the following error when running the test with the code change you requested:
=== release test-tls-key-mismatch ===
Path: parallel/test-tls-key-mismatch
assert.js:45
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Missing expected exception.
at innerThrows (assert.js:683:7)
at Function.throws (assert.js:702:3)
at Object.<anonymous> (/src/repos/personal/node/test/parallel/test-tls-key-mismatch.js:41:8)
at Module._compile (module.js:599:30)
at Object.Module._extensions..js (module.js:610:10)
at Module.load (module.js:518:32)
at tryModuleLoad (module.js:481:12)
at Function.Module._load (module.js:473:3)
at Function.Module.runMain (module.js:640:10)
at startup (bootstrap_node.js:187:16)
Command: out/Release/node /src/repos/personal/node/test/parallel/test-tls-key-mismatch.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kasimdoctor make sure to use 'agent2-cert.pem'
for the cert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpinca Thanks! That was a dumb mistake on my part 😄
@@ -21,6 +21,7 @@ | |||
|
|||
'use strict'; | |||
const common = require('../common'); | |||
const fixtures = require('../common/fixtures'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you please move this after the common.hasCrypto
check?
38aefae
to
f79277d
Compare
f79277d
to
c0b79a5
Compare
@jasnell @pawelgolda @lpinca Comments addressed. Please have a look again. Thanks! |
CI is green! |
PR-URL: #15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
|
Landed in 006fdb2 . Thanks for the contribution! |
PR-URL: #15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs/node#15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #15810 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Action-> Replaced
common.fixturesDir
intest-tls-key-mismatch.js
withcommon.fixtures
modulePushed as part of Node.js Interactive 2017 Code n Learn!
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test