(t *testing.T)
| 14 | const testTenantID = "test" |
| 15 | |
| 16 | func TestApplyPollResults(t *testing.T) { |
| 17 | tests := []struct { |
| 18 | name string |
| 19 | metas PerTenant |
| 20 | compacted PerTenantCompacted |
| 21 | expectedTenants []string |
| 22 | }{ |
| 23 | { |
| 24 | name: "all nil", |
| 25 | expectedTenants: []string{}, |
| 26 | }, |
| 27 | { |
| 28 | name: "meta only", |
| 29 | metas: PerTenant{ |
| 30 | "test": []*backend.BlockMeta{ |
| 31 | { |
| 32 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000001"), |
| 33 | }, |
| 34 | }, |
| 35 | "test2": []*backend.BlockMeta{ |
| 36 | { |
| 37 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000001"), |
| 38 | }, |
| 39 | }, |
| 40 | }, |
| 41 | expectedTenants: []string{"test", "test2"}, |
| 42 | }, |
| 43 | { |
| 44 | name: "compacted meta only", |
| 45 | compacted: PerTenantCompacted{ |
| 46 | "test": []*backend.CompactedBlockMeta{ |
| 47 | { |
| 48 | BlockMeta: backend.BlockMeta{ |
| 49 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000001"), |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | "test2": []*backend.CompactedBlockMeta{ |
| 54 | { |
| 55 | BlockMeta: backend.BlockMeta{ |
| 56 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000001"), |
| 57 | }, |
| 58 | }, |
| 59 | { |
| 60 | BlockMeta: backend.BlockMeta{ |
| 61 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000002"), |
| 62 | }, |
| 63 | }, |
| 64 | }, |
| 65 | }, |
| 66 | expectedTenants: []string{}, |
| 67 | }, |
| 68 | { |
| 69 | name: "all", |
| 70 | metas: PerTenant{ |
| 71 | "test": []*backend.BlockMeta{ |
| 72 | { |
| 73 | BlockID: backend.MustParse("00000000-0000-0000-0000-000000000001"), |
nothing calls this directly
no test coverage detected