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

Function TestHasMissingSpans

cmd/tempo-vulture/main_test.go:25–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestHasMissingSpans(t *testing.T) {
26 cases := []struct {
27 trace *tempopb.Trace
28 expected bool
29 }{
30 {
31 &tempopb.Trace{
32 ResourceSpans: []*v1.ResourceSpans{
33 {
34 ScopeSpans: []*v1.ScopeSpans{
35 {
36 Spans: []*v1.Span{
37 {
38 ParentSpanId: []byte("01234"),
39 },
40 },
41 },
42 },
43 },
44 },
45 },
46 true,
47 },
48 {
49 &tempopb.Trace{
50 ResourceSpans: []*v1.ResourceSpans{
51 {
52 ScopeSpans: []*v1.ScopeSpans{
53 {
54 Spans: []*v1.Span{
55 {
56 SpanId: []byte("01234"),
57 },
58 {
59 ParentSpanId: []byte("01234"),
60 },
61 },
62 },
63 },
64 },
65 },
66 },
67 false,
68 },
69 }
70
71 for _, tc := range cases {
72 require.Equal(t, tc.expected, hasMissingSpans(tc.trace))
73 }
74}
75
76func TestResponseFixture(t *testing.T) {
77 seed := time.Unix(1636729665, 0)

Callers

nothing calls this directly

Calls 2

hasMissingSpansFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected