-
Notifications
You must be signed in to change notification settings - Fork 30k
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: switch to use common.fixtures.readKey #15814
test: switch to use common.fixtures.readKey #15814
Conversation
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.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.
You can find the docs for fixtures.readKey()
at https://github.com/nodejs/node/tree/master/test/common#fixturesreadkeyarg-enc
test/parallel/test-https-strict.js
Outdated
@@ -33,7 +34,7 @@ const fs = require('fs'); | |||
const path = require('path'); | |||
|
|||
function file(fname) { | |||
return path.resolve(common.fixturesDir, 'keys', fname); | |||
return path.resolve(fixtures.fixturesDir, 'keys', fname); |
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 looks like the path.resolve()
itself could be replaced by fixtures.path('keys', fname)
.
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.
Actually, it looks like the file()
wrapper is only used by read()
, which is only being used for keys. The read('agent1-key.pem')
calls below can probably be replaced directly with fixtures.readKey('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.
Done.
As per review feedback, there is already a function in common.fixture that handles the logic of reading key files. Switch to use that.
@@ -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?
I will need someone else to commit this PR for me since I don't have the right to push master. |
CI: https://ci.nodejs.org/job/node-test-commit/12959/ @UnrememberMe this PR should get landed in the next couple of days (at most). We have over 200 new PRs from the Code and Learn, and we're working through them. If it's not landed in the next few days feel free to ping us. |
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 seem to be making use of fixtures.readKey
, not fixtures.fixturesDir
so the PR title may be changed to that effect?
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: #15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 4e2e15f |
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: nodejs/node#15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: #15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: #15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: #15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
code and learn 2017 first task is to switch from common.fixturesDir to common.fixtures.fixturesDir in test-https-strict.js PR-URL: #15814 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
switch from common.fixturesDir to common.fixtures.readKey in test-https-strict.js
PR-URL: #15814
Refs: code-and-learn 2017 node.js interactive
Reviewed-By: @benjamingr, @UnrememberMe, @cjihrig, @tniessen, @richardlau