MCPcopy Create free account
hub / github.com/cortexproject/cortex / compareRuleGroupDescToStateDesc

Function compareRuleGroupDescToStateDesc

pkg/ruler/ruler_test.go:637–645  ·  view source on GitHub ↗
(t *testing.T, expected *rulespb.RuleGroupDesc, got *GroupStateDesc)

Source from the content-addressed store, hash-verified

635}
636
637func compareRuleGroupDescToStateDesc(t *testing.T, expected *rulespb.RuleGroupDesc, got *GroupStateDesc) {
638 require.Equal(t, got.Group.Name, expected.Name)
639 require.Equal(t, got.Group.Namespace, expected.Namespace)
640 require.Len(t, expected.Rules, len(got.ActiveRules))
641 for i := range got.ActiveRules {
642 require.Equal(t, expected.Rules[i].Record, got.ActiveRules[i].Rule.Record)
643 require.Equal(t, expected.Rules[i].Alert, got.ActiveRules[i].Rule.Alert)
644 }
645}
646
647func TestGetRules(t *testing.T) {
648 // ruler ID -> (user ID -> list of groups).

Callers 2

TestRuler_RulesFunction · 0.85
TestRuler_QueryOffsetFunction · 0.85

Calls 2

EqualMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected