Skip to content

Commit 237eab2

Browse files
use const instead of recording and alerting string in api_test.go
1 parent f895615 commit 237eab2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/prometheus/v1/api_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,14 +771,14 @@ func TestAPIs(t *testing.T) {
771771
Name: "HighRequestLatency",
772772
Query: "job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5",
773773
LastError: "",
774-
Type: "alerting",
774+
Type: string(RuleTypeAlerting),
775775
},
776776
RecordingRule{
777777
Health: RuleHealthGood,
778778
Name: "job:http_inprogress_requests:sum",
779779
Query: "sum(http_inprogress_requests) by (job)",
780780
LastError: "",
781-
Type: "recording",
781+
Type: string(RuleTypeRecording),
782782
},
783783
},
784784
},
@@ -872,7 +872,7 @@ func TestAPIs(t *testing.T) {
872872
},
873873
Name: "HighRequestLatency",
874874
Query: "job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5",
875-
Type: "alerting",
875+
Type: string(RuleTypeAlerting),
876876
EvaluationTime: 0.5,
877877
LastEvaluation: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC),
878878
State: "firing",
@@ -881,7 +881,7 @@ func TestAPIs(t *testing.T) {
881881
Health: RuleHealthGood,
882882
Name: "job:http_inprogress_requests:sum",
883883
Query: "sum(http_inprogress_requests) by (job)",
884-
Type: "recording",
884+
Type: string(RuleTypeRecording),
885885
EvaluationTime: 0.3,
886886
LastEvaluation: time.Date(2020, 5, 18, 15, 52, 53, 450311300, time.UTC),
887887
},

0 commit comments

Comments
 (0)