Context
CashPilot runs a health check scheduler every 5 minutes that records container state in the health_events table. The health score (0-100) is calculated from uptime and restart frequency.
Task
- Write a test that simulates health events (start, check_ok, check_down, restart)
- Verify the health score calculation produces expected values
- Verify the
/api/health/scores endpoint returns scores in the correct format
Reference
app/main.py — health check scheduler and API endpoints
app/database.py — health_events table
Context
CashPilot runs a health check scheduler every 5 minutes that records container state in the
health_eventstable. The health score (0-100) is calculated from uptime and restart frequency.Task
/api/health/scoresendpoint returns scores in the correct formatReference
app/main.py— health check scheduler and API endpointsapp/database.py— health_events table