Skip to content

Testing

Adam edited this page Sep 12, 2026 · 2 revisions

Testing

pip install -r requirements-dev.txt
pytest

Covers the DB layer (including multi-service incidents/maintenance), the auto-incident lifecycle (service and integration-driven, including the startup grace period, retries, and the per-service API health check merge logic), maintenance-window scheduling and editing (including the checkbox-list service picker), notification dispatch, badge/feed rendering, two-factor authentication (enrollment, the two-step login, step-up on host/system control, the host-level reset file), CSRF protection, the public report-a-problem form (anti-spam honeypot/timing/rate-limit, admin review flow), the incident/maintenance-history auto-hide and "load more" pagination, the Discord bot's message-building logic (/status and /snapshot, including the guild/channel whitelists' behavior), login/lockout, and its stop()/restart() connection lifecycle, the self-updater (version comparison, channel filtering, download integrity/size/checksum checks, archive path validation, the file-replacement and automatic-rollback paths, and the emergency rollback - all against in-memory zips and a mocked requests, never a real download and never a real restart), service grouping, the slow-status/high-load logic, host/VM/app/Discord-bot restart controls (against a mocked subprocess.run/os.execv/fake event loop - the real commands and a real Discord gateway connection are never invoked by the test suite), the Jellyfin/*Arr/Jellyseerr/Bazarr/Tdarr/Byparr/qBittorrent/Games Portal status parsing (against mocked responses - there's no way to test against real instances of those, or the Windows-only temperature/per-disk-I/O code, from here), per-user notifications (the queue, channel gating, admin defaults/overrides), and the external notification API (/api/notify/admin//api/notify/user — key validation, payload checks, and the handoff into the same delivery paths above). Not part of requirements.txt since nothing here needs pytest at runtime.

Clone this wiki locally