-
Notifications
You must be signed in to change notification settings - Fork 170
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
Fix resolv.conf search parsing #635
Conversation
Makefile
Outdated
busted: dependencies $(ROVER) ## Test Lua. | ||
@$(ROVER) exec bin/busted | ||
BUSTED_FILES ?= | ||
busted: dependencies $(ROVER) ## Test Lua. To test a specific file: make busted BUSTED_FILES=spec/resty/testname.lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidor now you can select which busted test to execute from the Makefile
too :)
Makefile
Outdated
busted: dependencies $(ROVER) ## Test Lua. | ||
@$(ROVER) exec bin/busted | ||
BUSTED_FILES ?= | ||
busted: dependencies $(ROVER) ## Test Lua. To test a specific file: make busted BUSTED_FILES=spec/resty/testname.lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sold. I don't think this needs to be documented.
If you are skilled enough to want to run just one test you'll just run bin/busted
without the makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 72f9a66
Makefile
Outdated
@@ -61,7 +61,7 @@ endif | |||
prove: HARNESS ?= TAP::Harness | |||
prove: PROVE_FILES ?= $(shell find t examples -type f -name "*.t") | |||
prove: export TEST_NGINX_RANDOMIZE=1 | |||
prove: $(ROVER) nginx cpan ## Test nginx | |||
prove: $(ROVER) nginx cpan ## Test nginx. To execute a specific test: make prove PROVE_FILES=t/testname.t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here to. I don't intend PROVE_FILES
to be documented and used by public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 72f9a66
spec/resty/resolver_spec.lua
Outdated
search localdomain.example.com local | ||
nameserver 127.0.0.2 | ||
nameserver 127.0.0.1 | ||
search localdomain.example.com local #search nameserver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have created a new test for this instead of modifying the existing one.
I think that having it('ignores comments after search or nameserver', function() ...)
would make the tests cleaner. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok @davidor so maybe create two more like one for parsing a file without commentaries and other for commentaries after nameserver and search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done a339d4b
a339d4b
to
c052e30
Compare
Makefile
Outdated
busted: dependencies $(ROVER) ## Test Lua. | ||
@$(ROVER) exec bin/busted | ||
BUSTED_FILES ?= | ||
busted: dependencies $(ROVER) ## Test Lua. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 3c177e4
Makefile
Outdated
@@ -61,7 +61,7 @@ endif | |||
prove: HARNESS ?= TAP::Harness | |||
prove: PROVE_FILES ?= $(shell find t examples -type f -name "*.t") | |||
prove: export TEST_NGINX_RANDOMIZE=1 | |||
prove: $(ROVER) nginx cpan ## Test nginx | |||
prove: $(ROVER) nginx cpan ## Test nginx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another trailing whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 3c177e4
spec/resty/resolver_spec.lua
Outdated
@@ -176,10 +195,25 @@ search localdomain.example.com local | |||
nameserver 127.0.0.2 | |||
nameserver 127.0.0.1 | |||
]]) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bunch of whitespace here. We probably should have some linter for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I'm trying to get this vscode right but I think I will just go back to VI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 3c177e4
c052e30
to
3c177e4
Compare
Makefile
Outdated
busted: dependencies $(ROVER) ## Test Lua. | ||
@$(ROVER) exec bin/busted | ||
BUSTED_FILES ?= | ||
busted: dependencies $(ROVER) ## Tezs Lua. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
spec/resty/resolver_spec.lua
Outdated
]]) | ||
end) | ||
|
||
it('returns nameserver touples', function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuples
spec/resty/resolver_spec.lua
Outdated
assert.same({ '127.0.0.1', 53 }, nameservers[2]) | ||
end) | ||
|
||
it('returns nameserver touples ignoring commentaries', function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuples
433fd58
to
10c3178
Compare
- create more test cases for it - let `make busted` select test files
10c3178
to
a8daad4
Compare
Corrects parsing
search local.domain #foobar
in #630