Skip to content

Enable email notifications for messages/test_email_*.py - #1095

Merged
mdujava merged 2 commits into
3scale-qe:mainfrom
cathal-bailey:enable-email-notifications
Sep 25, 2026
Merged

mdujava merged 2 commits into
3scale-qe:mainfrom
cathal-bailey:enable-email-notifications

Conversation

@cathal-bailey

@cathal-bailey cathal-bailey commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

After porta PR #4039 was merged in Alpha build, email notifications changed from account-level to per-user NotificationPreferences. Fresh 3scale deployments have notifications disabled by default, causing all email notification tests to fail.

  • Add conftest.py fixture to automatically enable required notifications (account_created, application_created, service_contract_created, account_deleted) before tests run
  • Fix KeyError in test_email_accounts.py:100 when assertion fails (assert comment tried to access tpl['Headers'], which doesn't exist)
  • Add retry logic to MailhogClient.request() to handle stale connections between tests, fixing ConnectionError exceptions
  • Porta now includes a Contact Name field in account signup notification emails. Added .* wildcard regex to absorb optional fields.

@cathal-bailey cathal-bailey changed the title PR to enable email notifications for email tests. Enable email notifications for messages/test_email_*.py Aug 27, 2026

@mdujava mdujava left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like this test to stay non-disruptive, therefor not to use session fixture that changes all accounts or any rake commands if that's not documented way how to update notification settings.

Comment thread testsuite/mailhog.py Resolved
@cathal-bailey
cathal-bailey marked this pull request as ready for review September 1, 2026 14:32
@cathal-bailey
cathal-bailey force-pushed the enable-email-notifications branch from 44449b3 to a88aa9a Compare September 11, 2026 12:55
Updating notification list to enable service_deleted

Updating comment for assert

Enabling notifications through API enpoints rather than rails runner

Adding .* wildcard after the Email field in mail_templates.yml
@mdujava
mdujava force-pushed the enable-email-notifications branch from 3f36de6 to 32218ed Compare September 25, 2026 15:04
@mdujava
mdujava merged commit d5eeaee into 3scale-qe:main Sep 25, 2026
1 check passed
@cathal-bailey
cathal-bailey deleted the enable-email-notifications branch October 13, 2026 08:56
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.

3 participants