MCPcopy
hub / github.com/grafana/tempo / TestDeprecatedVersions

Function TestDeprecatedVersions

tempodb/config_test.go:124–177  ·  tempodb/config_test.go::TestDeprecatedVersions
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func 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
179func TestValidateCompactorConfig(t *testing.T) {
180 compactorConfig := CompactorConfig{

Callers

nothing calls this directly

Calls 3

validateConfigFunction · 0.85
ErrorMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected