-
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
balancer.t conversion to blackbox #1416
base: master
Are you sure you want to change the base?
Conversation
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.
Looking at the test, that it does not test the functionality on top of apicast, would it make more sense to move this test to unittests in spec/resty/balancer/round_robin_spec.lua
??
t/balancer.t
Outdated
{ | ||
"proxy": { | ||
"policy_chain": [ | ||
{ "name": "apicast.policy.upstream", |
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.
instead of upstream
poilicy, maybe better "api_backend": "http://test:$TEST_NGINX_SERVER_PORT/",
?
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 added it, with authentication as I did not find a straightforward way to use "api_backend" w/o authentication in other blackbox enabled tests. Is there a way to disable authentication as it does not seem to be needed for this test?
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.
Is there a way to disable authentication as it does not seem to be needed for this test?
You can add a policy in the policy chain called default_credentials. However, it is not a big deal to add ?user_key=value
as you did. I think it is ok like 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.
I see, having unauthenticated requests is not a common use case. Thank you @eguzki !
Looking good |
any update? this is still in draft |
Runs OK within docker environment, returning the expected 1 1 in sequence
Not sure if all the components are in place before the test, though. In the original test require('resty.balancer.round_robin').cache_size = 1 was set globally and here it is set on each request.