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

Function testFindByTraceID

tempodb/wal/wal_test.go:146–166  ·  view source on GitHub ↗
(t *testing.T, e encoding.VersionedEncoding)

Source from the content-addressed store, hash-verified

144}
145
146func testFindByTraceID(t *testing.T, e encoding.VersionedEncoding) {
147 f := func(ids [][]byte, objs []*tempopb.Trace, block common.WALBlock) {
148 // find all traces pushed
149 ctx := context.Background()
150 for i, id := range ids {
151 obj, err := block.FindTraceByID(ctx, id, common.DefaultSearchOptions())
152 require.NoError(t, err)
153 require.Equal(t, objs[i], obj.Trace)
154 }
155 }
156
157 // Test with both append methods
158 t.Run("Append", func(t *testing.T) {
159 t.Parallel()
160 runWALTestWithAppendMode(t, e.Version(), false, f)
161 })
162 t.Run("AppendTrace", func(t *testing.T) {
163 t.Parallel()
164 runWALTestWithAppendMode(t, e.Version(), true, f)
165 })
166}
167
168func TestIterator(t *testing.T) {
169 for _, e := range encoding.AllEncodingsForWrites() {

Callers 1

TestFindByTraceIDFunction · 0.85

Calls 6

DefaultSearchOptionsFunction · 0.92
runWALTestWithAppendModeFunction · 0.85
FindTraceByIDMethod · 0.65
VersionMethod · 0.65
EqualMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected