diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index 2e1795c0b..7dec5b9a5 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -147,8 +147,8 @@ func TestSendAlerts(t *testing.T) { { in: []*rules.Alert{ { - Labels: []labels.Label{{Name: "l1", Value: "v1"}}, - Annotations: []labels.Label{{Name: "a2", Value: "v2"}}, + Labels: labels.FromStrings("l1", "v1"), + Annotations: labels.FromStrings("a2", "v2"), ActiveAt: time.Unix(1, 0), FiredAt: time.Unix(2, 0), ValidUntil: time.Unix(3, 0), @@ -156,8 +156,8 @@ func TestSendAlerts(t *testing.T) { }, exp: []*notifier.Alert{ { - Labels: []labels.Label{{Name: "l1", Value: "v1"}}, - Annotations: []labels.Label{{Name: "a2", Value: "v2"}}, + Labels: labels.FromStrings("l1", "v1"), + Annotations: labels.FromStrings("a2", "v2"), StartsAt: time.Unix(2, 0), EndsAt: time.Unix(3, 0), GeneratorURL: "http://localhost:9090/graph?g0.expr=up&g0.tab=1", @@ -167,8 +167,8 @@ func TestSendAlerts(t *testing.T) { { in: []*rules.Alert{ { - Labels: []labels.Label{{Name: "l1", Value: "v1"}}, - Annotations: []labels.Label{{Name: "a2", Value: "v2"}}, + Labels: labels.FromStrings("l1", "v1"), + Annotations: labels.FromStrings("a2", "v2"), ActiveAt: time.Unix(1, 0), FiredAt: time.Unix(2, 0), ResolvedAt: time.Unix(4, 0), @@ -176,8 +176,8 @@ func TestSendAlerts(t *testing.T) { }, exp: []*notifier.Alert{ { - Labels: []labels.Label{{Name: "l1", Value: "v1"}}, - Annotations: []labels.Label{{Name: "a2", Value: "v2"}}, + Labels: labels.FromStrings("l1", "v1"), + Annotations: labels.FromStrings("a2", "v2"), StartsAt: time.Unix(2, 0), EndsAt: time.Unix(4, 0), GeneratorURL: "http://localhost:9090/graph?g0.expr=up&g0.tab=1",