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

Function TestApplyPollResults

tempodb/blocklist/list_test.go:16–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14const testTenantID = "test"
15
16func 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"),

Callers

nothing calls this directly

Calls 8

MustParseFunction · 0.92
ApplyPollResultsMethod · 0.80
NewFunction · 0.70
TenantsMethod · 0.65
RunMethod · 0.45
EqualMethod · 0.45
MetasMethod · 0.45
CompactedMetasMethod · 0.45

Tested by

no test coverage detected