Skip to content

https: made some improvements to test-https-agent.js#8517

Closed
Williams-Dan wants to merge 4 commits into
nodejs:masterfrom
Williams-Dan:GoodFirstContribution
Closed

https: made some improvements to test-https-agent.js#8517
Williams-Dan wants to merge 4 commits into
nodejs:masterfrom
Williams-Dan:GoodFirstContribution

Conversation

@Williams-Dan

Copy link
Copy Markdown
Contributor
Checklist
  • [ x] make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • [x ] commit message follows commit guidelines
Affected core subsystem(s)

https test

Description of change

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Added some comments to make it clear what the test is doing and changed 'var' to 'const' where possible.

Also added .idea to the gitignore file

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Added some comments to make it clear what the test is doing and changed 'var' to 'const' where possible.
@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Sep 13, 2016
@lpinca lpinca added test Issues and PRs related to the tests. https Issues or PRs related to the https subsystem. and removed meta Issues and PRs related to the general management of the project. labels Sep 13, 2016
Comment thread .gitignore Outdated
*.VC.opendb
.vs/
.vscode/
.idea/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't change .gitignore. There is another PR specifically for this and it is still being discussed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you need .idea/ in your .gitignore, consider adding it to a personal global .gitignore file instead. https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

@Trott

Trott commented Sep 13, 2016

Copy link
Copy Markdown
Member

Nit: Keep the first line of the commit message to under 50 chars. I would suggest this:

test: refactor test/parallel/test-https-agent.js

@Trott

Trott commented Sep 13, 2016

Copy link
Copy Markdown
Member

Aside from @lpinca's comments and barring anything discovered in CI, the changes look good to me.

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

@cjihrig

cjihrig commented Sep 13, 2016

Copy link
Copy Markdown
Contributor

LGTM once the comments are addressed.

Removed redundant comments, and removed .idea from gitignore
@Trott

Trott commented Sep 14, 2016

Copy link
Copy Markdown
Member

LGTM

Comment thread test/parallel/test-https-agent.js Outdated
@@ -37,7 +38,7 @@ server.listen(0, function() {
}, function(res) {
res.resume();
console.log(res.statusCode);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about replacing this line with assert.strictEqual(res.statusCode, 200);?

Replaced console.log(res.statusCode); with and assertion, Rather than logging the https request status on every loop it will now assert the https status is correct on every loop.
@yorkie

yorkie commented Sep 15, 2016

Copy link
Copy Markdown
Contributor

This is my first good contribution, on line 40 replaced '==' with '===' for a strict compare, on line 52 I replaces 'assert.equal' with 'assert.strictEqual' again for a strict compare.

Hey, should we label this as "good first contribution"?

if (++responses == N * M) server.close();
assert.strictEqual(res.statusCode, 200);
if (++responses === N * M) server.close();
}).on('error', function(e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would change this to on('error', common.fail) or on('error', function(e) { throw e; }); not sure what is the preferred way, looks like both are used in other tests.

@lpinca

lpinca commented Sep 15, 2016

Copy link
Copy Markdown
Member

Left one last comment, then I think we are ready to go.

@lpinca

lpinca commented Sep 15, 2016

Copy link
Copy Markdown
Member

@yorkie is that label used for PRs? I though it was for issues only.

@yorkie

yorkie commented Sep 15, 2016

Copy link
Copy Markdown
Contributor

@lpinca I dunno too, never mind :)

Changed the error listener to throw the error rather than log it.

@jasnell jasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lpinca lpinca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Trott pushed a commit to Trott/io.js that referenced this pull request Sep 16, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

Replaced console.log(res.statusCode); with and assertion.

Rather than logging the https request status on every loop it will now
assert the https status is correct on every loop.

Changed the error listener to throw the error rather than log it.

PR-URL: nodejs#8517
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@Trott

Trott commented Sep 16, 2016

Copy link
Copy Markdown
Member

Landed in a89c23f

@Trott Trott closed this Sep 16, 2016
MylesBorins pushed a commit that referenced this pull request Oct 6, 2016
On line 40: replace '==' with '==='

On line 52: replace 'assert.equal' with 'assert.strictEqual'

Added some comments.

Changed 'var' to 'const' where possible.

Replaced console.log(res.statusCode); with and assertion.

Rather than logging the https request status on every loop it will now
assert the https status is correct on every loop.

Changed the error listener to throw the error rather than log it.

PR-URL: #8517
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

8 participants