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

Function TestIndexMarshalUnmarshal

tempodb/backend/tenantindex_test.go:13–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestIndexMarshalUnmarshal(t *testing.T) {
14 tests := []struct {
15 idx *TenantIndex
16 }{
17 {
18 idx: &TenantIndex{},
19 },
20 {
21 idx: &TenantIndex{
22 CreatedAt: time.Now(),
23 Meta: []*BlockMeta{
24 NewBlockMeta("test", uuid.New(), "v1"),
25 NewBlockMeta("test", uuid.New(), "v2"),
26 NewBlockMeta("test", uuid.New(), "v3"),
27 },
28 },
29 },
30 {
31 idx: &TenantIndex{
32 CreatedAt: time.Now(),
33 CompactedMeta: []*CompactedBlockMeta{
34 {
35 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
36 CompactedTime: time.Now(),
37 },
38 {
39 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
40 CompactedTime: time.Now(),
41 },
42 {
43 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
44 CompactedTime: time.Now(),
45 },
46 },
47 },
48 },
49 {
50 idx: &TenantIndex{
51 Meta: []*BlockMeta{
52 NewBlockMeta("test", uuid.New(), "v1"),
53 NewBlockMeta("test", uuid.New(), "v2"),
54 NewBlockMeta("test", uuid.New(), "v3"),
55 },
56 CompactedMeta: []*CompactedBlockMeta{
57 {
58 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
59 CompactedTime: time.Now(),
60 },
61 {
62 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
63 CompactedTime: time.Now(),
64 },
65 {
66 BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"),
67 CompactedTime: time.Now(),
68 },
69 },
70 },

Callers

nothing calls this directly

Calls 7

unmarshalMethod · 0.95
unmarshalPbMethod · 0.95
NewBlockMetaFunction · 0.85
marshalMethod · 0.80
marshalPbMethod · 0.80
NowMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected