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

Function TestTenantIndexBuilder

tempodb/blocklist/poller_test.go:39–199  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37func (m *mockJobSharder) Owns(_ string) bool { return m.owns }
38
39func TestTenantIndexBuilder(t *testing.T) {
40 var (
41 one = backend.MustParse("00000000-0000-0000-0000-000000000001")
42 two = backend.MustParse("00000000-0000-0000-0000-000000000002")
43 three = backend.MustParse("00000000-0000-0000-0000-000000000003")
44 )
45
46 tests := []struct {
47 name string
48 list PerTenant
49 compactedList PerTenantCompacted
50 expectedList PerTenant
51 expectedCompactedList PerTenantCompacted
52 expectsError bool
53 }{
54 {
55 name: "nothing!",
56 expectedList: PerTenant{},
57 expectedCompactedList: PerTenantCompacted{},
58 },
59 {
60 name: "err",
61 list: PerTenant{
62 "test": []*backend.BlockMeta{
63 {
64 BlockID: one,
65 },
66 },
67 },
68 expectsError: true,
69 },
70 {
71 name: "block meta",
72 list: PerTenant{
73 "test": []*backend.BlockMeta{
74 {
75 BlockID: one,
76 },
77 },
78 },
79 expectedList: PerTenant{
80 "test": []*backend.BlockMeta{
81 {
82 BlockID: one,
83 },
84 },
85 },
86 expectedCompactedList: PerTenantCompacted{
87 "test": []*backend.CompactedBlockMeta{},
88 },
89 },
90 {
91 name: "compacted block meta",
92 compactedList: PerTenantCompacted{
93 "test": []*backend.CompactedBlockMeta{
94 {
95 BlockMeta: backend.BlockMeta{
96 BlockID: one,

Callers

nothing calls this directly

Calls 9

DoMethod · 0.95
MustParseFunction · 0.92
newMockCompactorFunction · 0.85
newMockReaderFunction · 0.85
newBlocklistFunction · 0.85
NewPollerFunction · 0.85
ErrorMethod · 0.65
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected