test: io.Discard logger in fix-3 tests

This commit is contained in:
2026-07-12 10:08:39 +02:00
parent d8f6069b46
commit 6ab8f943af
2 changed files with 7 additions and 5 deletions
@@ -1,6 +1,7 @@
package web
import (
"io"
"log"
"strings"
"testing"
@@ -10,7 +11,7 @@ import (
// clears it. COMPANION red-proof: skip SetDeadAppAlerts entirely (the pre-fix-3 silence) → GetAlerts
// has no dead-app banner → the "not fut" assertion fails.
func TestDeadAppAlerts_PresentAndSelfClearing(t *testing.T) {
am := NewAlertManager(log.New(nil, "", 0))
am := NewAlertManager(log.New(io.Discard, "", 0))
am.SetDeadAppAlerts([]DeadApp{{Name: "cwa", DisplayName: "Calibre-Web", State: "stopped"}})
got := am.GetAlerts()
@@ -31,7 +32,7 @@ func TestDeadAppAlerts_PresentAndSelfClearing(t *testing.T) {
// Above the group threshold, many dead apps collapse to ONE grouped banner (a reboot storm must not
// paper the dashboard).
func TestDeadAppAlerts_GroupedAboveThreshold(t *testing.T) {
am := NewAlertManager(log.New(nil, "", 0))
am := NewAlertManager(log.New(io.Discard, "", 0))
var many []DeadApp
for _, n := range []string{"radarr", "jellyfin", "navidrome", "calibre", "seerr"} {
many = append(many, DeadApp{Name: n, DisplayName: n, State: "stopped"})