summaryrefslogtreecommitdiff
path: root/internal/html_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-21 23:40:14 +0200
committerPaul Buetow <paul@buetow.org>2026-01-21 23:40:14 +0200
commit4e3459bee4ecc8ceef33b0a876e584b494ad4e4a (patch)
tree3cd76c41bef90f8ccc9d5fda8b8031b0f9281c03 /internal/html_test.go
parent64c4f058e6f9975effb38e952531458054f512c3 (diff)
add OnlyIfNotExists alert suppression feature
Adds ability to suppress alerts during maintenance windows by checking for the existence of a file. When the file exists and is recent (within configured max age), matching alerts are excluded from email reports. Features: - Global PrometheusOnlyIfNotExists config for Prometheus alerts - Per-check OnlyIfNotExists config for individual checks - Configurable max age (default 86400s) for suppression file - New "Suppressed alerts" section in email and HTML reports - Suppressed checks excluded from counts and unhandled sections Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/html_test.go')
-rw-r--r--internal/html_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/html_test.go b/internal/html_test.go
index d482eda..b77c937 100644
--- a/internal/html_test.go
+++ b/internal/html_test.go
@@ -219,7 +219,7 @@ func TestHtmlReport(t *testing.T) {
}
subject := "GOGIOS Report [C:1 W:1 U:0 S:1 OK:2]"
- result := s.htmlReport(subject)
+ result := s.htmlReport(subject, config{})
// Check that all major sections are present
expectedSections := []string{
@@ -228,6 +228,7 @@ func TestHtmlReport(t *testing.T) {
"Alerts with status changed",
"Unhandled alerts",
"Stale alerts",
+ "Suppressed alerts",
"Generated by Gogios",
"</html>",
}
@@ -399,7 +400,7 @@ func TestW3CCompliance(t *testing.T) {
}
subject := "GOGIOS Report [C:1 W:0 U:0 S:0 OK:0]"
- html := s.htmlReport(subject)
+ html := s.htmlReport(subject, config{})
// W3C HTML5 Required Elements
requiredElements := map[string]string{