watcher: startup notification no longer says every endpoint works (closes #230)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The startup notification ended "All notification channels are working.", but it is written once and handed to every notification endpoint before any delivery has succeeded or failed, so the claim was never checked and was false whenever one endpoint refused it. It now says only that it is a test sent to every configured notification endpoint. The startup notification test checks the whole message. Model: opus-5-5
This commit was merged in pull request #241.
This commit is contained in:
@@ -875,18 +875,27 @@ func TestSendTestNotification_ViaRun(t *testing.T) {
|
||||
|
||||
notifications := deps.notifier.getNotifications()
|
||||
|
||||
// No names are configured, so every count is 0.
|
||||
wantMessage := "dnswatcher has started and completed its initial scan.\n" +
|
||||
"Monitoring 0 domain(s) and 0 hostname(s).\n" +
|
||||
"Tracking 0 port endpoint(s) and 0 TLS certificate(s).\n" +
|
||||
"This is a test notification, sent to every configured " +
|
||||
"notification endpoint."
|
||||
|
||||
found := false
|
||||
|
||||
for _, n := range notifications {
|
||||
if n.Priority == "success" &&
|
||||
n.Title == "✅ dnswatcher startup complete" {
|
||||
n.Title == "✅ dnswatcher startup complete" &&
|
||||
n.Message == wantMessage {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
t.Errorf(
|
||||
"expected startup test notification, got: %v",
|
||||
"expected startup test notification with message %q, got: %v",
|
||||
wantMessage,
|
||||
notifications,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user