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

chore(tests): remove hardcoded dns resolver in tests #9748

Merged
merged 4 commits into from
Nov 14, 2022

Conversation

fffonion
Copy link
Contributor

@fffonion fffonion commented Nov 11, 2022

FT-3133

@fffonion fffonion changed the title step1 remove in conf chore(tests) remove hardcoded dns resolver in tests Nov 11, 2022
@fffonion fffonion changed the title chore(tests) remove hardcoded dns resolver in tests chore(tests): remove hardcoded dns resolver in tests Nov 11, 2022
@fffonion fffonion added pr/wip A work in progress PR opened to receive feedback and removed pr/wip A work in progress PR opened to receive feedback labels Nov 11, 2022
@fffonion
Copy link
Contributor Author

@hanshuebner I ran a grep over spec/ and found those are relevant and can be removed.
8.8.8.8 also exists in multiple tests but I checked them one by one and looks they are placeholders
and no DNS queries are actually sent.

spec/01-unit/21-dns-client/01-utils_spec.lua:nameserver 8.8.8.8
spec/01-unit/21-dns-client/01-utils_spec.lua:nameserver 8.8.8.8:1234 ; this one has a port number (limited systems support this)
spec/01-unit/21-dns-client/01-utils_spec.lua:      assert.is.same({ "8.8.8.8", "2602:306:bca8:1ac0::1", "8.8.8.8:1234" }, resolv.nameserver)
spec/01-unit/21-dns-client/01-utils_spec.lua:nameserver 8.8.8.8
spec/01-unit/21-dns-client/01-utils_spec.lua:nameserver 8.8.8.8
spec/01-unit/21-dns-client/01-utils_spec.lua:              "nameserver 8.8.8.8 ",
spec/01-unit/21-dns-client/03-client_cache_spec.lua:        nameservers = { "8.8.8.8" },
spec/01-unit/21-dns-client/03-client_cache_spec.lua:        nameservers = { "8.8.8.8" },
spec/01-unit/21-dns-client/03-client_cache_spec.lua:        nameservers = { "8.8.8.8" },
spec/01-unit/21-dns-client/03-client_cache_spec.lua:        nameservers = { "8.8.8.8" },
spec/01-unit/21-dns-client/02-client_spec.lua:          nameservers = { "8.8.8.8:53" },
spec/01-unit/21-dns-client/02-client_spec.lua:            nameservers = { "8.8.8.8:53" },
spec/01-unit/21-dns-client/02-client_spec.lua:            nameservers = { "8.8.8.8:53" },
spec/01-unit/21-dns-client/02-client_spec.lua:            nameservers = { "8.8.8.8:53" },
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:              "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:            "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:          "nameserver 8.8.8.8",
spec/01-unit/21-dns-client/02-client_spec.lua:        "nameserver 8.8.8.8",
spec/01-unit/03-conf_loader_spec.lua:        dns_resolver = "8.8.8.8:53"
spec/01-unit/03-conf_loader_spec.lua:        dns_resolver = "8.8.8.8,1.2.3.4:53,::1,[::1]:53"
spec/01-unit/09-balancer/04-round_robin_spec.lua:        "nameserver 8.8.8.8"
spec/01-unit/09-balancer/04-round_robin_spec.lua:        { name = "getkong.test", address = "8.8.8.8" },
spec/01-unit/09-balancer/04-round_robin_spec.lua:          "nameserver 8.8.8.8"
spec/01-unit/09-balancer/03-consistent_hashing_spec.lua:        "nameserver 8.8.8.8"
spec/01-unit/09-balancer/01-generic_spec.lua:          "nameserver 8.8.8.8"
spec/01-unit/09-balancer/02-least_connections_spec.lua:        "nameserver 8.8.8.8"
spec/01-unit/04-prefix_handler_spec.lua:        dns_resolver = { "8.8.8.8", "8.8.4.4" }
spec/01-unit/14-dns_spec.lua:    nameservers = { "8.8.8.8" },

Let me know if this is covering your original thought : )

@hanshuebner
Copy link
Contributor

8.8.8.8 also exists in multiple tests but I checked them one by one and looks they are placeholders and no DNS queries are actually sent.

I would suggest using an address different from 8.8.8.8 so that the address can never accidentally used for lookups. 198.51.100.0 would be a good address, at it is in a reserved test address block that will never be allocated (RFC5737)

@fffonion fffonion force-pushed the remove/hardcode-dns branch 2 times, most recently from cedbb33 to 7ab7691 Compare November 11, 2022 09:48
@fffonion
Copy link
Contributor Author

looks like there does exist some test in spec/01-unit/21-dns-client/02-client_spec.lua are doing real DNS queries,
i will fix them to honor system resolv.conf next week.

@fffonion
Copy link
Contributor Author

@hanshuebner can use another review now, thanks!

@fffonion fffonion merged commit 004fa2d into master Nov 14, 2022
@fffonion fffonion deleted the remove/hardcode-dns branch November 14, 2022 09:56
oowl pushed a commit that referenced this pull request Aug 15, 2024
* tests(api): adding otel log tests

* remove package-lock file

* tests(api): address otel-log pr comments

* tests(api): change file split logic to newline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants