mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add more unit tests
Signed-off-by: Raphael Silva <rapphil@gmail.com>
This commit is contained in:
parent
ee70c9d145
commit
5fe8bafaeb
|
@ -2468,6 +2468,37 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
||||||
},
|
},
|
||||||
zeroFunc: rulesZeroFunc,
|
zeroFunc: rulesZeroFunc,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
endpoint: api.rules,
|
||||||
|
query: url.Values{
|
||||||
|
"maxRuleGroups": []string{"1"},
|
||||||
|
"nextToken": []string{getRuleGroupNextToken("/path/to/file", "grp2")},
|
||||||
|
},
|
||||||
|
response: &RuleDiscovery{
|
||||||
|
RuleGroups: []*RuleGroup{
|
||||||
|
{
|
||||||
|
Name: "grp2",
|
||||||
|
File: "/path/to/file",
|
||||||
|
Interval: 1,
|
||||||
|
Limit: 0,
|
||||||
|
Rules: []Rule{
|
||||||
|
AlertingRule{
|
||||||
|
State: "inactive",
|
||||||
|
Name: "test_metric3",
|
||||||
|
Query: "absent(test_metric3) != 1",
|
||||||
|
Duration: 1,
|
||||||
|
Labels: labels.Labels{},
|
||||||
|
Annotations: labels.Labels{},
|
||||||
|
Alerts: []*Alert{},
|
||||||
|
Health: "ok",
|
||||||
|
Type: "alerting",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
zeroFunc: rulesZeroFunc,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
endpoint: api.queryExemplars,
|
endpoint: api.queryExemplars,
|
||||||
query: url.Values{
|
query: url.Values{
|
||||||
|
|
Loading…
Reference in a new issue