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: add env name into test, and replace comons.fixtureDir with comm.fixtures #15816

Closed
wants to merge 7 commits into from

Conversation

shaohui-liu2000
Copy link
Contributor

@shaohui-liu2000 shaohui-liu2000 commented Oct 6, 2017

Checklist
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
@shaohui-liu2000 shaohui-liu2000 changed the title add env name into test test: add env name into test Oct 6, 2017
@shaohui-liu2000 shaohui-liu2000 changed the title test: add env name into test test: add env name into test, and replace comons.fixtureDir with comm.fixtures Oct 6, 2017
@@ -10,7 +11,7 @@ const path = require('path');

// piping should work as expected with createWriteStream

const loc = path.join(common.fixturesDir, 'person.jpg');
const loc = path.join(fixtures.fixturesDir, 'person.jpg');
Copy link
Contributor

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.path instead of path.join.

sam-github
sam-github previously approved these changes Oct 6, 2017
@@ -10,8 +11,8 @@ const path = require('path');

// piping should work as expected with createWriteStream

const loc = path.join(common.fixturesDir, 'person.jpg');
const fn = path.join(common.tmpDir, 'http2pipe.jpg');
const loc = fixtures.path(fixtures.fixturesDir, 'person.jpg');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please have a look at fixtures.path definition you will see that you don't have to pass the fixturesDir anymore.

const loc = path.join(common.fixturesDir, 'person.jpg');
const fn = path.join(common.tmpDir, 'http2pipe.jpg');
const loc = fixtures.path(fixtures.fixturesDir, 'person.jpg');
const fn = fixtures.path(common.tmpDir, 'http2pipe.jpg');
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be unchanged as it's not related to fixtures.

@shaohui-liu2000
Copy link
Contributor Author

@pawelgolda PTAL

@pawelgolda
Copy link
Contributor

@shaohui-liu2000 looks good.

@@ -45,5 +45,5 @@ child.stdout.on('data', function(chunk) {

process.on('exit', function() {
assert.ok(response.includes('HELLO=WORLD'),
'spawn did not use process.env as default');
`spawn did not use process.env as default(process.env.HELLO = ${process.env.HELLO})`);
Copy link
Contributor

Choose a reason for hiding this comment

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

The linter doesn't like this long line :-(

It can be fixed by shortening the line a bit or by adding an eslint directive to the top of the file (near 'use strict';) with something like /* eslint-disable max-len */ (you can see examples of this being done in other tests, such as test/parallel/test-readline-keys.js and test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could disable the rule, but you shouldn't ;-). The line needs wrapping. This can be seen locally by calling make eslint.

Copy link
Member

Choose a reason for hiding this comment

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

Can you change this line to something like:

'spawn did not use process.env as default' +
`(process.env.HELLO = ${process.env.HELLO})`);

so we don't have to disable the eslint rule?

@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 child_process Issues and PRs related to the child_process subsystem. http2 Issues or PRs related to the http2 subsystem. labels Oct 6, 2017
@@ -1,6 +1,7 @@
'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?

Copy link
Member

Choose a reason for hiding this comment

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

Uh..now after the update there are two fixtures. I don't think it can run with two const fixtures defined? Can you remove this line?

@joyeecheung
Copy link
Member

This should be landed as two commits.

CI: https://ci.nodejs.org/job/node-test-pull-request/10635/

@gireeshpunathil
Copy link
Member

@sam-github @rmg @lpinca - PTAL.

jasnell pushed a commit that referenced this pull request Oct 13, 2017
PR-URL: #15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 13, 2017
PR-URL: #15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 13, 2017

Landed in 28e6cab and 7245e85

@jasnell jasnell closed this Oct 13, 2017
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 15, 2017
PR-URL: nodejs/node#15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 15, 2017
PR-URL: nodejs/node#15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Oct 18, 2017
PR-URL: #15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Oct 18, 2017
PR-URL: #15816
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. http2 Issues or PRs related to the http2 subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.