Alerting: Update GetRuleGroupAlertRules to accept optional rule group (#46889)

* rename GetRuleGroupAlertRules to GetAlertRules
* make rule group optional in GetAlertRulesQuery
* simplify FakeStore. the current structure did not support optional rule group
This commit is contained in:
Yuriy Tseretyan
2022-03-23 17:36:25 +00:00
committed by GitHub
parent 562a25ad99
commit 4ee48c2e77
7 changed files with 73 additions and 130 deletions
+3 -3
View File
@@ -109,12 +109,12 @@ func CreateTestAlertRuleWithLabels(t *testing.T, ctx context.Context, dbstore *s
})
require.NoError(t, err)
q := models.ListRuleGroupAlertRulesQuery{
q := models.GetAlertRulesQuery{
OrgID: orgID,
NamespaceUID: "namespace",
RuleGroup: ruleGroup,
RuleGroup: &ruleGroup,
}
err = dbstore.GetRuleGroupAlertRules(ctx, &q)
err = dbstore.GetAlertRules(ctx, &q)
require.NoError(t, err)
require.NotEmpty(t, q.Result)