(t *testing.T)
| 51 | ) |
| 52 | |
| 53 | func TestConfig_ShouldSupportYamlConfig(t *testing.T) { |
| 54 | yamlCfg := ` |
| 55 | block_ranges: [2h, 48h] |
| 56 | consistency_delay: 1h |
| 57 | block_sync_concurrency: 123 |
| 58 | data_dir: /tmp |
| 59 | compaction_interval: 15m |
| 60 | compaction_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 | |
| 74 | func TestConfig_ShouldSupportCliFlags(t *testing.T) { |
| 75 | fs := flag.NewFlagSet("", flag.PanicOnError) |
nothing calls this directly
no test coverage detected