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

balancer.t conversion to blackbox #1416

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

odkq
Copy link

@odkq odkq commented Oct 23, 2023

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.

@odkq odkq requested a review from a team as a code owner October 23, 2023 16:21
@odkq odkq marked this pull request as draft October 23, 2023 16:50
Copy link
Member

@eguzki eguzki left a 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",
Copy link
Member

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/", ?

Copy link
Author

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?

Copy link
Member

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

Copy link
Author

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 !

@eguzki
Copy link
Member

eguzki commented Nov 14, 2023

Looking good

@eguzki
Copy link
Member

eguzki commented Jan 15, 2024

any update? this is still in draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants