-
-
Notifications
You must be signed in to change notification settings - Fork 2k
tests: new sending and filtering functions #3786
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
The new function, called `_send_email_with_mid`, aligns with suggestions from @polarethene and is heavily simplified compared to its predecessor `_send_email_and_get_id`. New helpers will be introduced to filter logs according to the MID constructed in this function.
065298e to
6503f24
Compare
|
I'll review this after v13.3 is out, trying to wrap up some tasks in time for that π |
Nice! This is basically just me implementing what you proposed in #3747 (comment). |
polarathene
left a comment
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'll apply these.
Bulk of the changes are:
_mid/MID=>_msgid/MSG_ID- Revised documentation / tooltip comments
- `_mid` / `MID` => `_msgid` / `MSG_ID` - Revised documentation / tooltip comments
polarathene
left a comment
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'd personally prefer being more explicit about those that are using regex, potentially with a _regex variant of such methods π€·ββοΈ
Probably unlikely to be an issue but technically all those logs being checked for addresses will treat the . as any character rather than an actual .? Fixed string matching by default seems better suited?
Feel free to delay that to a separate PR.
Great work! π₯³
Moreover, I added a function to print the whole mail log. Appropriate comments were added to this function to indicate that one should only use this function when necessary.
polarathene
left a comment
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'll apply some of these, and leave some others unresolved for better visibility to you π
polarathene
left a comment
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.
Just the prior review feedback and some additional feedback here to address and this looks good to go! π π
| _service_log_should_contain_string 'rspamd' 'reject "ClamAV FOUND VIRUS "Eicar-Signature"' | ||
|
|
||
| _print_mail_log_for_id "${MAIL_ID_VIRUS}" | ||
| _print_mail_log_of_queue_id_from_msgid 'rspamd-test-email-virus' |
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.
Similar to the dms-test-email-spam, it might be nice to have the equivalent for virus. Not required to be addressed in this PR though since there's plenty of noise here already π
|
Huzzah! A failure like I expected π |
polarathene
left a comment
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 π
May want to merge this after the base image upgrade PR?
|
Yes, this is fine with me :) |
|
I resolved merge conflicts and enabled auto-merge. When you approve @polarathene, this will automatically be merged into |
polarathene
left a comment
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.
π
Description
This PR is intended to solve concerns raised in #3747 (comment) by @polarathene.
A new file for log filter helpers was created. Thereafter,
_send_email_and_get_idwas reworked to become_send_email_with_mid. I paid attention to using sub-shells only where necessary. This new way of sending + filtering allows for greater flexibility and the implementation has become easier. Last but not least, I updated the service log filters and applied them throughout all our tests to improve code quality.Review commit by commit.
Type of change
Checklist:
docs/)CHANGELOG.md