Skip to content

Commit

Permalink
use const instead of recording and alerting string in api_test.go
Browse files Browse the repository at this point in the history
Signed-off-by: sarthak.tyagi <[email protected]>
  • Loading branch information
sarthaktyagi-505 committed Jul 10, 2024
1 parent c302ac5 commit 94e8319
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/prometheus/v1/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
},
Expand Down Expand Up @@ -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",
Expand All @@ -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),
},
Expand Down

0 comments on commit 94e8319

Please sign in to comment.