Notify on failed runs and with ntfy disabled

This commit is contained in:
2026-11-12 01:55:28 +00:00
parent 2330f50268
commit 7b1b91f452
10 changed files with 78 additions and 37 deletions
@@ -334,16 +334,15 @@ func TestRunNotificationAttentionModesAndRetryBound(t *testing.T) {
r.notifyRun(id, "test", status, sequence, "stage", "")
}
}
// auto waiting, on waiting and on failed; an auto run's failure is silent
// because run_finished defaults off.
if calls.Load() != 3 {
t.Fatalf("attention modes: %d calls, want 3", calls.Load())
// auto and on waiting, plus auto and on failed; off never notifies.
if calls.Load() != 4 {
t.Fatalf("attention modes: %d calls, want 4", calls.Load())
}
r.deliverRunNotifications(time.Now().Add(time.Minute))
r.deliverRunNotifications(time.Now().Add(2 * time.Minute))
r.deliverRunNotifications(time.Now().Add(3 * time.Minute))
if calls.Load() != 9 {
t.Fatalf("retry bound: %d calls, want 9", calls.Load())
if calls.Load() != 12 {
t.Fatalf("retry bound: %d calls, want 12", calls.Load())
}
for _, id := range []int64{1, 2, 3} {
got, err := s.RunNotifications(ctx, id)