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 tests for dnsPromises.lookup #21559

Closed
wants to merge 2 commits into from

Conversation

shisama
Copy link
Contributor

@shisama shisama commented Jun 27, 2018

Added tests for dnsPromises.lookup to increase coverage and test
onlookup() and onlookupall() methods.

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jun 27, 2018
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

There are already tests for these things in the internet suite. Unfortunately, those don't count toward code coverage.

@shisama
Copy link
Contributor Author

shisama commented Jun 27, 2018

@cjihrig Code coverage report for internal/dns/promises.js(
27/06/2018 03:26)
shows lines of uncovered code.
This adds tests to cover code in onlookup() and onlookupall().

@jasnell
Copy link
Member

jasnell commented Jun 29, 2018

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

@shisama
Copy link
Contributor Author

shisama commented Jul 15, 2018

@cjihrig I found the tests for these in internet. Please tell me which tests for dns should be in internet or the others. The tests in internet don't run on CI.

@cjihrig
Copy link
Contributor

cjihrig commented Jul 16, 2018

Generally, tests that require the Internet should be in the internet suite. Those tests are more prone to network issues, but unfortunately are not run as part of the normal CI.

@shisama
Copy link
Contributor Author

shisama commented Jul 16, 2018

Thanks for your reply. OK, I'll fix this.

@shisama
Copy link
Contributor Author

shisama commented Aug 1, 2018

@cjihrig The tests that require the Internet were removed. But tests to check error with invalid host name are remained to improve coverage. Please take a look again.

@jasnell
Copy link
Member

jasnell commented Aug 12, 2018

Masashi Hirano added 2 commits August 14, 2018 01:21
Added tests for dnsPromises.lookup to increase coverage and test
`onlookup()` and `onlookupall()` methods.
@shisama
Copy link
Contributor Author

shisama commented Aug 13, 2018

@jasnell node-test-commit-freebsd fails but I think it is not related to this. I'm not sure if it will be success, but I rebased this. Would you please run CI again?

@jasnell
Copy link
Member

jasnell commented Aug 13, 2018

freebsd re-build: https://ci.nodejs.org/job/node-test-commit-freebsd/19630/

@shisama
Copy link
Contributor Author

shisama commented Aug 14, 2018

@jasnell Thank you to run CI again, but it failed. I think it is related to #17849 (flaky test).

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 23, 2018
@BridgeAR
Copy link
Member

@refack
Copy link
Contributor

refack commented Aug 23, 2018

Generally, tests that require the Internet should be in the internet suite. Those tests are more prone to network issues, but unfortunately are not run as part of the normal CI.

@addaleax did a wonderful job of writing a mock DNS server in common/dns.js, for example:

const dnstools = require('../common/dns');

@addaleax
Copy link
Member

Landed in 2118342

@addaleax addaleax closed this Aug 24, 2018
addaleax pushed a commit that referenced this pull request Aug 24, 2018
Added tests for dnsPromises.lookup to increase coverage and test
`onlookup()` and `onlookupall()` methods.

PR-URL: #21559
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
targos pushed a commit that referenced this pull request Aug 24, 2018
Added tests for dnsPromises.lookup to increase coverage and test
`onlookup()` and `onlookupall()` methods.

PR-URL: #21559
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@joyeecheung
Copy link
Member

The remaining test cases still rely on internet access and will fail if the DNS is hijacked by the ISP. I move them to internet in #22516

targos pushed a commit that referenced this pull request Sep 3, 2018
Added tests for dnsPromises.lookup to increase coverage and test
`onlookup()` and `onlookupall()` methods.

PR-URL: #21559
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@refack
Copy link
Contributor

refack commented Sep 10, 2018

image
You can finally see the improved coverage in our published report 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants