Add tests for website monitor and notification flows #10

Closed
opened 2026-05-22 17:44:18 -06:00 by Agent · 2 comments

Add backend and worker tests covering website monitor creation, check result storage, incident open/recovery, encrypted notification channels, and webhook payloads.

Add backend and worker tests covering website monitor creation, check result storage, incident open/recovery, encrypted notification channels, and webhook payloads.
Author

Partial backend coverage implemented in 68d5e0a.

Summary:

  • Added SQLite-backed API test fixtures with authenticated owner override.
  • Added website monitor tests covering asset creation, TLS config persistence, default alert rule creation, and disabled default alerts.
  • Added notification channel tests verifying webhook URLs are encrypted and not returned by create/list/update responses.
  • Updated progress docs to note remaining worker alert-evaluation and notification-delivery test coverage.

Verified:

  • docker compose exec -T backend pytest

Current result: 5 passed, 1 warning. Warning tracked separately as #17.

Partial backend coverage implemented in 68d5e0a. Summary: - Added SQLite-backed API test fixtures with authenticated owner override. - Added website monitor tests covering asset creation, TLS config persistence, default alert rule creation, and disabled default alerts. - Added notification channel tests verifying webhook URLs are encrypted and not returned by create/list/update responses. - Updated progress docs to note remaining worker alert-evaluation and notification-delivery test coverage. Verified: - docker compose exec -T backend pytest Current result: 5 passed, 1 warning. Warning tracked separately as #17.
Author

Completed remaining worker coverage in 19d4c6e.

Summary:

  • Added worker scheduler tests for alert threshold incident opening.
  • Added recovery resolution coverage.
  • Added notification history/deduplication coverage.
  • Added alert cooldown coverage.
  • Fixed cooldown timestamp comparison to normalize incident timestamps to UTC, which keeps SQLite-backed tests and timezone-aware runtime comparisons consistent.
  • Updated progress docs.

Verified:

  • docker compose exec -T worker python -m unittest discover -s tests
  • docker compose exec -T backend pytest

Current backend warning remains tracked separately as #17.

Completed remaining worker coverage in 19d4c6e. Summary: - Added worker scheduler tests for alert threshold incident opening. - Added recovery resolution coverage. - Added notification history/deduplication coverage. - Added alert cooldown coverage. - Fixed cooldown timestamp comparison to normalize incident timestamps to UTC, which keeps SQLite-backed tests and timezone-aware runtime comparisons consistent. - Updated progress docs. Verified: - docker compose exec -T worker python -m unittest discover -s tests - docker compose exec -T backend pytest Current backend warning remains tracked separately as #17.
Agent closed this issue 2026-05-23 19:51:56 -06:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ksmith/OrbitWard#10