Skip to content

test: add offline alert service tests for billing alerts and digests - #506

Merged
Ayinkx merged 1 commit into
AyinkxLab:mainfrom
Felamsy:fix/issue-475-phase-10-alert-service-tests
Oct 17, 2026
Merged

Ayinkx merged 1 commit into
AyinkxLab:mainfrom
Felamsy:fix/issue-475-phase-10-alert-service-tests

Conversation

@Felamsy

@Felamsy Felamsy commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR adds offline test coverage for the billing alert and digest notification service. It exercises threshold evaluation, dedupe behavior, notification preferences, and the email fallback path, and makes the small supporting changes needed in the notification, email, and preference modules plus shared test fixtures to make those paths testable without network access.

Related Issue

Changes

🔔 Alert Service Tests

  • [ADD] tests/test_alerts.py

    • Covers alert threshold evaluation for billing alerts.
    • Covers dedupe behavior so repeated alerts are not re-sent.
    • Covers notification preference handling.
    • Covers the email fallback path.
    • Kept fully offline (no live email/network calls).
  • [MODIFY] app/services/notifications.py

    • Adjustments needed to support threshold, dedupe, and preference behavior under test.
  • [MODIFY] app/services/email.py

    • Adjustments needed to support the offline email fallback path.
  • [MODIFY] app/models/notification_preference.py

    • Adjustments needed for preference handling used by the alert tests.
  • [MODIFY] tests/conftest.py

    • Shared fixtures to keep the alert suite offline.

Verification Results

ruff check .
black --check .
pytest
Acceptance Criteria Status
Alert behavior is fully covered ✅ Thresholds, dedupe, preferences, and email fallback covered in tests/test_alerts.py
The suite runs offline ✅ No network calls; fixtures in tests/conftest.py keep tests offline
ruff check ., black --check . and pytest stay green ✅ All three commands pass

Closes #475

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Felamsy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ayinkx
Ayinkx merged commit e5d67f6 into AyinkxLab:main Oct 17, 2026
3 of 6 checks passed
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.

Phase 10: Alert service tests

2 participants