Skip to content
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: In test/parallel/test-https-drain.js, use fixtures.fixturesDir #15841

Conversation

szhangpitt
Copy link

@szhangpitt szhangpitt commented Oct 6, 2017

This is a task at Node.js Interactive 2017 Code & Learn. The task reads:

In test/parallel/test-https-drain.js, replace common.fixturesDir with usage of common.fixtures module (see https://github.com/nodejs/node/tree/master/test/common#fixtures-module)

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 6, 2017
@szhangpitt szhangpitt changed the title In test/parallel/test-https-drain.js, use fixtures.fixturesDir test: In test/parallel/test-https-drain.js, use fixtures.fixturesDir Oct 6, 2017
There is already a function that does the path.join() with
fixturesDir. So this commit just uses that.
Copy link
Contributor

@rmg rmg left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!


const options = {
key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')),
cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))
key: fs.readFileSync(fixtures.path('test_key.pem')),
Copy link
Contributor

@rmg rmg Oct 6, 2017

Choose a reason for hiding this comment

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

This could be cleaned up further by making use of fixtures.readSync() to replace the fs.readFileSync and the path.join!

Something like key: fixtures.readSync('test_key.pem'),

@Trott Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 6, 2017
@mscdex mscdex added the https Issues or PRs related to the https subsystem. label Oct 6, 2017
@gibfahn
Copy link
Member

gibfahn commented Oct 6, 2017

@szhangpitt if you could push another commit to your branch that makes the change @rmg suggested that'd be ideal.

@szhangpitt
Copy link
Author

Thanks for the suggestion! will push another commit soon.

Based on @rmg suggestion, use fixtures.path() in place of fs.readFileSync()
@addaleax
Copy link
Member

@@ -21,17 +21,17 @@

'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
Copy link
Member

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?

@joyeecheung
Copy link
Member

Landed in 84f6964 with #15841 (review) fixed. Thanks!

joyeecheung pushed a commit that referenced this pull request Oct 13, 2017
PR-URL: #15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 15, 2017
PR-URL: nodejs/node#15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
targos pushed a commit that referenced this pull request Oct 18, 2017
PR-URL: #15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
PR-URL: #15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
PR-URL: #15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
PR-URL: #15841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. https Issues or PRs related to the https subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.