From f1ea5bf232836990d008f8912454021763c39db3 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Fri, 2 Sep 2016 14:12:31 +0200 Subject: [PATCH] Modify tests to adjust to reverting the /graph changes These tests have been added after the /graph changes and therefore already test the new syntax. This commit has to be reverted together with the previous one to get back to the old new state. *sigh* --- rules/alerting_test.go | 11 ++++++++--- rules/recording_test.go | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/rules/alerting_test.go b/rules/alerting_test.go index 194f316f7..aee679806 100644 --- a/rules/alerting_test.go +++ b/rules/alerting_test.go @@ -27,11 +27,16 @@ func TestAlertingRuleHTMLSnippet(t *testing.T) { } rule := NewAlertingRule("testrule", expr, 0, model.LabelSet{"html": "BOLD"}, model.LabelSet{"html": "BOLD"}) - const want = `ALERT testrule - IF foo{html="<b>BOLD<b>"} + // This is valid once the /graph changes have been reintroduced: + // const want = `ALERT testrule + // IF foo{html="<b>BOLD<b>"} + // LABELS {html="<b>BOLD</b>"} + // ANNOTATIONS {html="<b>BOLD</b>"}` + // This is valid once the /graph changes have been reintroduced: + const want = `ALERT testrule + IF foo{html="<b>BOLD<b>"} LABELS {html="<b>BOLD</b>"} ANNOTATIONS {html="<b>BOLD</b>"}` - got := rule.HTMLSnippet("/test/prefix") if got != want { t.Fatalf("incorrect HTML snippet; want:\n\n|%v|\n\ngot:\n\n|%v|", want, got) diff --git a/rules/recording_test.go b/rules/recording_test.go index 36b5ac1dd..8f597fa0a 100644 --- a/rules/recording_test.go +++ b/rules/recording_test.go @@ -76,7 +76,10 @@ func TestRecordingRuleHTMLSnippet(t *testing.T) { } rule := NewRecordingRule("testrule", expr, model.LabelSet{"html": "BOLD"}) - const want = `testrule{html="<b>BOLD</b>"} = foo{html="<b>BOLD<b>"}` + // This is valid once the /graph changes have been reintroduced: + // const want = `testrule{html="<b>BOLD</b>"} = foo{html="<b>BOLD<b>"}` + // This is what we need for now: + const want = `testrule{html="<b>BOLD</b>"} = foo{html="<b>BOLD<b>"}` got := rule.HTMLSnippet("/test/prefix") if got != want {