From 237eab2b5aef5c1959df340b2c513dee4dfa980c Mon Sep 17 00:00:00 2001 From: "sarthak.tyagi" Date: Wed, 10 Jul 2024 10:30:32 +0100 Subject: [PATCH] use const instead of recording and alerting string in api_test.go --- api/prometheus/v1/api_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/prometheus/v1/api_test.go b/api/prometheus/v1/api_test.go index cedea0610..dcd74e615 100644 --- a/api/prometheus/v1/api_test.go +++ b/api/prometheus/v1/api_test.go @@ -771,14 +771,14 @@ func TestAPIs(t *testing.T) { Name: "HighRequestLatency", Query: "job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5", LastError: "", - Type: "alerting", + Type: string(RuleTypeAlerting), }, RecordingRule{ Health: RuleHealthGood, Name: "job:http_inprogress_requests:sum", Query: "sum(http_inprogress_requests) by (job)", LastError: "", - Type: "recording", + Type: string(RuleTypeRecording), }, }, }, @@ -872,7 +872,7 @@ func TestAPIs(t *testing.T) { }, Name: "HighRequestLatency", Query: "job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5", - Type: "alerting", + Type: string(RuleTypeAlerting), EvaluationTime: 0.5, LastEvaluation: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC), State: "firing", @@ -881,7 +881,7 @@ func TestAPIs(t *testing.T) { Health: RuleHealthGood, Name: "job:http_inprogress_requests:sum", Query: "sum(http_inprogress_requests) by (job)", - Type: "recording", + Type: string(RuleTypeRecording), EvaluationTime: 0.3, LastEvaluation: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC), },