From 58256f8f6bd423ec5d67de5b11339269ce6855f7 Mon Sep 17 00:00:00 2001 From: Jiekun Date: Tue, 10 Sep 2024 15:09:22 +0800 Subject: [PATCH] feature: [vmalert] fix unit test --- app/vmalert/config/config_test.go | 2 +- app/vmalert/config/testdata/rules/rules-multi-doc-good.rules | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/vmalert/config/config_test.go b/app/vmalert/config/config_test.go index d847ddec8..069620bea 100644 --- a/app/vmalert/config/config_test.go +++ b/app/vmalert/config/config_test.go @@ -58,7 +58,7 @@ groups: } 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 { t.Fatalf("error parsing files %s", err) } diff --git a/app/vmalert/config/testdata/rules/rules-multi-doc-good.rules b/app/vmalert/config/testdata/rules/rules-multi-doc-good.rules index 6a51f73f6..267ea5479 100644 --- a/app/vmalert/config/testdata/rules/rules-multi-doc-good.rules +++ b/app/vmalert/config/testdata/rules/rules-multi-doc-good.rules @@ -21,7 +21,6 @@ groups: - alert: Conns expr: filterSeries(sumSeries(host.receiver.interface.cons),'last','>', 500) for: 3m - annotations: summary: Too high connection number 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 for: 3m 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}}"