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

Function TestLimitsLoadingFromYaml

pkg/util/validation/limits_test.go:241–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

239}
240
241func TestLimitsLoadingFromYaml(t *testing.T) {
242 SetDefaultLimitsForYAMLUnmarshalling(Limits{
243 MaxLabelNameLength: 100,
244 })
245
246 inp := `ingestion_rate: 0.5`
247
248 l := Limits{}
249 err := yaml.UnmarshalStrict([]byte(inp), &l)
250 require.NoError(t, err)
251
252 assert.Equal(t, 0.5, l.IngestionRate, "from yaml")
253 assert.Equal(t, 100, l.MaxLabelNameLength, "from defaults")
254}
255
256func TestLimitsLoadingFromJson(t *testing.T) {
257 SetDefaultLimitsForYAMLUnmarshalling(Limits{

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.65

Tested by

no test coverage detected