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

Function TestConfig_ShouldSupportYamlConfig

pkg/compactor/compactor_test.go:53–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51)
52
53func TestConfig_ShouldSupportYamlConfig(t *testing.T) {
54 yamlCfg := `
55block_ranges: [2h, 48h]
56consistency_delay: 1h
57block_sync_concurrency: 123
58data_dir: /tmp
59compaction_interval: 15m
60compaction_retries: 123
61`
62
63 cfg := Config{}
64 flagext.DefaultValues(&cfg)
65 assert.NoError(t, yaml.Unmarshal([]byte(yamlCfg), &cfg))
66 assert.Equal(t, cortex_tsdb.DurationList{2 * time.Hour, 48 * time.Hour}, cfg.BlockRanges)
67 assert.Equal(t, time.Hour, cfg.ConsistencyDelay)
68 assert.Equal(t, 123, cfg.BlockSyncConcurrency)
69 assert.Equal(t, "/tmp", cfg.DataDir)
70 assert.Equal(t, 15*time.Minute, cfg.CompactionInterval)
71 assert.Equal(t, 123, cfg.CompactionRetries)
72}
73
74func TestConfig_ShouldSupportCliFlags(t *testing.T) {
75 fs := flag.NewFlagSet("", flag.PanicOnError)

Callers

nothing calls this directly

Calls 3

DefaultValuesFunction · 0.92
EqualMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected