(list PerTenantCompacted, expectsError bool)
| 1363 | } |
| 1364 | |
| 1365 | func newMockCompactor(list PerTenantCompacted, expectsError bool) backend.Compactor { |
| 1366 | return &backend.MockCompactor{ |
| 1367 | BlockMetaFn: func(blockID uuid.UUID, tenantID string) (*backend.CompactedBlockMeta, error) { |
| 1368 | if expectsError { |
| 1369 | return nil, errors.New("err") |
| 1370 | } |
| 1371 | |
| 1372 | l, ok := list[tenantID] |
| 1373 | if !ok { |
| 1374 | return nil, backend.ErrDoesNotExist |
| 1375 | } |
| 1376 | |
| 1377 | for _, m := range l { |
| 1378 | if (uuid.UUID)(m.BlockID) == blockID { |
| 1379 | return m, nil |
| 1380 | } |
| 1381 | } |
| 1382 | |
| 1383 | return nil, backend.ErrDoesNotExist |
| 1384 | }, |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | func newMockReader(list PerTenant, compactedList PerTenantCompacted, expectsError bool) backend.Reader { |
| 1389 | tenants := []string{} |
no outgoing calls
no test coverage detected