-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: replace mock tests with real tests in udp-logger #9506
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
Conversation
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
| --- grep_error_log_out | ||
| sending a batch logs to 127.0.0.1:2000 | ||
| sending a batch logs to 127.0.0.1:2001 | ||
| sending a batch logs to 127.0.0.1:2002 |
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.
Maybe we also need replace these ports to real log 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.
@Sn0rt We can let these ones as it is, right?
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.
It’s okay, it’s better if a real udp logger is introduced to replace it
|
Maybe we should add more test cases with |
|
@Sn0rt please help to review |
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
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.
should I set the UDP port by 8125:8125/udp ?
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.
Yep this looks right. I made this change.
| "vip": "$remote_addr" | ||
| }, | ||
| "batch_max_size": 1, | ||
| "inactive_timeout": 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.
not needed to remove .
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.
it was added back in later commit
| --- grep_error_log_out | ||
| sending a batch logs to 127.0.0.1:2000 | ||
| sending a batch logs to 127.0.0.1:2001 | ||
| sending a batch logs to 127.0.0.1:2002 |
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.
It’s okay, it’s better if a real udp logger is introduced to replace it
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Co-authored-by: Tristan <jiangfucheng0914@foxmail.com>
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.
LGTM
| local code, _, _ = t("/hello", "GET") | ||
| if code >= 300 then | ||
| ngx.status = code | ||
| ngx.say("fail") | ||
| return | ||
| end |
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.
The test case's name is add plugin, but you also access the route in the test case, why not create a new test case to access?
=== TEST 10: access
--- request
GET /hello
--- response_body
passed
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.
@monkeyDluffy6017 renamed the tests appropriately.
| local code, _, _ = t("/hello", "GET") | ||
| if code >= 300 then | ||
| ngx.status = code | ||
| ngx.say("fail") | ||
| return | ||
| end |
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.
ditto, and remember to add a blank between two blocks
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
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
| return | ||
| end | ||
| ngx.say(body) | ||
| local code, _, _ = t("/hello", "GET") |
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.
need a blank before this block
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.
oops I had missed it. Added now. @monkeyDluffy6017
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Description
Currently we have mock tests with udp logger. This PR uses vector to replace them with real tests by checking the logs from logging server
Fixes # (issue)
Checklist