(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestDeprecatedVersions(t *testing.T) { |
| 125 | tests := []struct { |
| 126 | cfg *Config |
| 127 | expectedConfig *Config |
| 128 | err string |
| 129 | }{ |
| 130 | { |
| 131 | cfg: &Config{ |
| 132 | WAL: &wal.Config{ |
| 133 | Version: "vParquet5-preview1", // silently overwritten with the block version |
| 134 | }, |
| 135 | Block: &common.BlockConfig{ |
| 136 | BloomFP: 0.01, |
| 137 | BloomShardSizeBytes: 1, |
| 138 | Version: "vParquet4", |
| 139 | }, |
| 140 | }, |
| 141 | expectedConfig: &Config{ |
| 142 | WAL: &wal.Config{ |
| 143 | Version: "vParquet4", |
| 144 | }, |
| 145 | Block: &common.BlockConfig{ |
| 146 | BloomFP: 0.01, |
| 147 | BloomShardSizeBytes: 1, |
| 148 | Version: "vParquet4", |
| 149 | }, |
| 150 | }, |
| 151 | }, |
| 152 | { |
| 153 | cfg: &Config{ |
| 154 | WAL: &wal.Config{}, |
| 155 | Block: &common.BlockConfig{ |
| 156 | BloomFP: 0.01, |
| 157 | BloomShardSizeBytes: 1, |
| 158 | Version: "vParquet5-preview1", |
| 159 | }, |
| 160 | }, |
| 161 | err: "vParquet5-preview1 is not a valid block version for creating blocks", |
| 162 | }, |
| 163 | } |
| 164 | |
| 165 | for _, test := range tests { |
| 166 | err := validateConfig(test.cfg) |
| 167 | if test.err == "" { |
| 168 | require.Equal(t, nil, err) |
| 169 | } else { |
| 170 | assert.Contains(t, err.Error(), test.err) |
| 171 | } |
| 172 | |
| 173 | if test.expectedConfig != nil { |
| 174 | require.Equal(t, test.expectedConfig, test.cfg) |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func TestValidateCompactorConfig(t *testing.T) { |
| 180 | compactorConfig := CompactorConfig{ |
nothing calls this directly
no test coverage detected