feature: [vmalert] fix unit test

This commit is contained in:
Jiekun 2024-09-10 15:09:22 +08:00
parent adab15248d
commit 58256f8f6b
No known key found for this signature in database
GPG key ID: 4674A8E5B0AAF6CE
2 changed files with 2 additions and 3 deletions

View file

@ -58,7 +58,7 @@ groups:
} }
func TestParse_Success(t *testing.T) { func TestParse_Success(t *testing.T) {
_, err := Parse([]string{"testdata/rules/*multi-doc-good.rules", "testdata/dir/*good.*"}, notifier.ValidateTemplates, true) _, err := Parse([]string{"testdata/rules/*good.rules", "testdata/dir/*good.*"}, notifier.ValidateTemplates, true)
if err != nil { if err != nil {
t.Fatalf("error parsing files %s", err) t.Fatalf("error parsing files %s", err)
} }

View file

@ -21,7 +21,6 @@ groups:
- alert: Conns - alert: Conns
expr: filterSeries(sumSeries(host.receiver.interface.cons),'last','>', 500) expr: filterSeries(sumSeries(host.receiver.interface.cons),'last','>', 500)
for: 3m for: 3m
annotations: annotations:
summary: Too high connection number for {{$labels.instance}} \n\-\-\-\n summary: Too high connection number for {{$labels.instance}} \n\-\-\-\n
description: "It is {{ $value }} connections for {{$labels.instance}} \n---\n" description: "It is {{ $value }} connections for {{$labels.instance}} \n---\n"
@ -35,5 +34,5 @@ groups:
expr: sum(vm_tcplistener_conns) by (instance) > 1 expr: sum(vm_tcplistener_conns) by (instance) > 1
for: 3m for: 3m
annotations: annotations:
summary: \n markdown result is : ----\n # header\n body: \n text \n----\n" summary: "\n markdown result is : ----\n # header\n body: \n text \n----\n"
description: "It is {{ $value }} connections for {{$labels.instance}}" description: "It is {{ $value }} connections for {{$labels.instance}}"