MCPcopy Index your code
hub / github.com/cortexproject/cortex / defaultRulerConfig

Function defaultRulerConfig

pkg/ruler/ruler_test.go:64–89  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

62)
63
64func defaultRulerConfig(t testing.TB) Config {
65 t.Helper()
66
67 // Create a new temporary directory for the rules, so that
68 // each test will run in isolation.
69 rulesDir := t.TempDir()
70
71 codec := ring.GetCodec()
72 consul, closer := consul.NewInMemoryClient(codec, log.NewNopLogger(), nil)
73 t.Cleanup(func() { assert.NoError(t, closer.Close()) })
74
75 cfg := Config{}
76 flagext.DefaultValues(&cfg)
77 cfg.RulePath = rulesDir
78 cfg.Ring.KVStore.Mock = consul
79 cfg.Ring.NumTokens = 1
80 cfg.Ring.ListenPort = 0
81 cfg.Ring.InstanceAddr = "localhost"
82 cfg.Ring.InstanceID = "localhost"
83 cfg.Ring.FinalSleep = 0
84 cfg.Ring.ReplicationFactor = 1
85 cfg.EnableQueryStats = false
86 cfg.NameValidationScheme = model.UTF8Validation
87
88 return cfg
89}
90
91type ruleLimits struct {
92 mtx sync.RWMutex

Callers 15

TestBackUpRuleGroupsFunction · 0.85
TestRulerShutdownFunction · 0.85
TestRuler_TestShutdownFunction · 0.85
TestRuler_RulesFunction · 0.85
TestGetRulesFunction · 0.85
TestGetRulesFromBackupFunction · 0.85
getRulesHATestFunction · 0.85
TestRuler_ListAllRulesFunction · 0.85

Calls 3

GetCodecFunction · 0.92
DefaultValuesFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected