-
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: update test to use fixtures #15844
test: update test to use fixtures #15844
Conversation
test/parallel/test-tls-multi-key.js
Outdated
@@ -30,12 +31,12 @@ const fs = require('fs'); | |||
|
|||
const options = { | |||
key: [ | |||
fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), | |||
fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), | |||
fs.readFileSync(fixtures.path('/keys/ec-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
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.
Does it make a difference that fs.readFileSync() is platform specific (though only if the path is a directory I see...so not an issue). I've always been taught to keep it as simple as possible...so I assumed using path.join() is just a bit clearer? But live and learn! :)
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.
The readFileSync(fixtures(keys...)) pattern is so common in the tests that the fixtures.readKey
wrapper was created to handle it. Take a look at fixtures.readKey()
!
Something like fixtures.readKey('ec-key.pem')
.
Well that makes sense! Thank you! I'll make the change when I get back to my computer! |
soft ping @dinophile |
Sorry! Was travelling to and from a lot of places over the long weekend! I'm now back at work and have pushed the fix! Thanks for everyone's patience! |
test/parallel/test-tls-multi-key.js
Outdated
@@ -1,4 +1,4 @@ | |||
// Copyright Joyent, Inc. and other Node contributors. | |||
no// Copyright Joyent, Inc. and other Node contributors. |
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.
unexpected manual error? please correct it
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.
Oh dear...trackpad issues! Thanks! Fixed!
test/parallel/test-tls-multi-key.js
Outdated
@@ -21,21 +21,21 @@ | |||
|
|||
'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: would you mind moving this after the common.hasCrypto
check?
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.
Not at all! Done!
CI lint failure is unrelated and fixed in #16145 |
PR-URL: #15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
landed in 5d80f00 |
PR-URL: nodejs/node#15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #15844 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)