From 581677b635c6e775729810c79c403aa86be4ebb2 Mon Sep 17 00:00:00 2001 From: Luca Bigliardi Date: Sat, 25 Jan 2020 16:16:10 +0000 Subject: [PATCH] Update tests to handle new fingerprint field Signed-off-by: Luca Bigliardi --- http_test.go | 4 ++-- testdata.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/http_test.go b/http_test.go index 843d2e9..2b2d233 100644 --- a/http_test.go +++ b/http_test.go @@ -189,11 +189,11 @@ func TestTemplateErrorsCreateRawAlertNotice(t *testing.T) { expectedAlertNotices := []AlertNotice{ AlertNotice{ Channel: "#somechannel", - Alert: `{"status":"resolved","labels":{"alertname":"airDown","instance":"instance1:3456","job":"air","service":"prometheus","severity":"ticket","zone":"global"},"annotations":{"DESCRIPTION":"service /prometheus has irc gateway down on instance1","SUMMARY":"service /prometheus air down on instance1"},"startsAt":"2017-05-15T13:49:37.834Z","endsAt":"2017-05-15T13:50:37.835Z","generatorURL":"https://prometheus.example.com/prometheus/..."}`, + Alert: `{"status":"resolved","labels":{"alertname":"airDown","instance":"instance1:3456","job":"air","service":"prometheus","severity":"ticket","zone":"global"},"annotations":{"DESCRIPTION":"service /prometheus has irc gateway down on instance1","SUMMARY":"service /prometheus air down on instance1"},"startsAt":"2017-05-15T13:49:37.834Z","endsAt":"2017-05-15T13:50:37.835Z","generatorURL":"https://prometheus.example.com/prometheus/...","fingerprint":"66214a361160fb6f"}`, }, AlertNotice{ Channel: "#somechannel", - Alert: `{"status":"resolved","labels":{"alertname":"airDown","instance":"instance2:7890","job":"air","service":"prometheus","severity":"ticket","zone":"global"},"annotations":{"DESCRIPTION":"service /prometheus has irc gateway down on instance2","SUMMARY":"service /prometheus air down on instance2"},"startsAt":"2017-05-15T11:47:37.834Z","endsAt":"2017-05-15T11:48:37.834Z","generatorURL":"https://prometheus.example.com/prometheus/..."}`, + Alert: `{"status":"resolved","labels":{"alertname":"airDown","instance":"instance2:7890","job":"air","service":"prometheus","severity":"ticket","zone":"global"},"annotations":{"DESCRIPTION":"service /prometheus has irc gateway down on instance2","SUMMARY":"service /prometheus air down on instance2"},"startsAt":"2017-05-15T11:47:37.834Z","endsAt":"2017-05-15T11:48:37.834Z","generatorURL":"https://prometheus.example.com/prometheus/...","fingerprint":"25a874c99325d1ce"}`, }, } expectedStatusCode := 200 diff --git a/testdata.go b/testdata.go index ce5981c..40dec10 100644 --- a/testdata.go +++ b/testdata.go @@ -40,6 +40,7 @@ const ( }, "endsAt": "2017-05-15T13:50:37.835Z", "generatorURL": "https://prometheus.example.com/prometheus/...", + "fingerprint": "66214a361160fb6f", "labels": { "alertname": "airDown", "instance": "instance1:3456", @@ -58,6 +59,7 @@ const ( }, "endsAt": "2017-05-15T11:48:37.834Z", "generatorURL": "https://prometheus.example.com/prometheus/...", + "fingerprint": "25a874c99325d1ce", "labels": { "alertname": "airDown", "instance": "instance2:7890",