-
Notifications
You must be signed in to change notification settings - Fork 115
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
notifications: no long tasks email for certain users #14674
notifications: no long tasks email for certain users #14674
Conversation
trigger: test-robottelo |
PRT Result
|
'wait_for_no_long_running_task_mail', | ||
) | ||
def test_negative_no_notification_for_long_running_tasks( | ||
admin_user_with_custom_settings, long_running_task, root_mailbox_copy |
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 code looks rock-solid. One question here, why does this test require the root_mailbox_copy
fixture?
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.
Good catch, I actually wanted to ensure that a clean mailbox file is created, but it is already done in fixture wait_for_no_long_running_task_mail
via clean_root_mailbox
.
But since you mentioned it, I decided to keep it and added few lines to check for the unexpected mail explicitly.
Read more below...
Bugzilla: https://bugzilla.redhat.com/2245056 Verify that users with disabled account or disabled email don't receive email notifications about long-running tasks.
21bf130
to
5a94b8b
Compare
for email in root_mailbox_copy: | ||
assert ( | ||
task_id not in email.as_string() | ||
), f'Unexpected notification e-mail with long-running task ID {task_id} found in user mailbox!' |
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.
IMO this gives the test more "believable" look since nothing much else looks to be happening here 😉
And it's also a double safety, because if this assert fails, it means that the unwanted mail somehow slipped through wait_for_no_long_running_task_mail
fixture (meaning it's not working as it should).
trigger: test-robottelo |
PRT Result
|
notifications: exclude some users from long-running tasks email Bugzilla: https://bugzilla.redhat.com/2245056 Verify that users with disabled account or disabled email don't receive email notifications about long-running tasks. (cherry picked from commit ce6777c)
notifications: exclude some users from long-running tasks email Bugzilla: https://bugzilla.redhat.com/2245056 Verify that users with disabled account or disabled email don't receive email notifications about long-running tasks.
Problem Statement
Users with disabled account or disabled email were still receiving notifications about long-running tasks.
Solution
New test that verifies that these users don't receive the notification.
Related Issues
Bugzilla: https://bugzilla.redhat.com/2245056