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

Function testConfig

tempodb/tempodb_test.go:45–75  ·  view source on GitHub ↗
(t *testing.T, blocklistPoll time.Duration, opts ...testConfigOption)

Source from the content-addressed store, hash-verified

43type testConfigOption func(*Config)
44
45func testConfig(t *testing.T, blocklistPoll time.Duration, opts ...testConfigOption) (Reader, Writer, Compactor, string) {
46 tempDir := t.TempDir()
47
48 cfg := &Config{
49 Backend: backend.Local,
50 Local: &local.Config{
51 Path: path.Join(tempDir, "traces"),
52 },
53 Block: &common.BlockConfig{
54 BloomFP: .01,
55 BloomShardSizeBytes: 100_000,
56 Version: encoding.DefaultEncoding().Version(),
57 },
58 WAL: &wal.Config{
59 Filepath: path.Join(tempDir, "wal"),
60 },
61 BlocklistPoll: blocklistPoll,
62 Search: &SearchConfig{
63 ChunkSizeBytes: 1_000_000,
64 ReadBufferCount: 8, ReadBufferSizeBytes: 4 * 1024 * 1024,
65 },
66 }
67
68 for _, opt := range opts {
69 opt(cfg)
70 }
71
72 r, w, c, err := New(cfg, nil, log.NewNopLogger())
73 require.NoError(t, err)
74 return r, w, c, tempDir
75}
76
77func TestDB(t *testing.T) {
78 r, w, c, _ := testConfig(t, 0)

Callers 10

TestDBFunction · 0.70
TestBlockShardingFunction · 0.70
TestNilOnUnknownTenantIDFunction · 0.70
TestBlockCleanupFunction · 0.70
testCompleteBlockFunction · 0.70
TestNoCompactFlagFunction · 0.70
TestPollNotificationFunction · 0.70

Calls 4

DefaultEncodingFunction · 0.92
NewFunction · 0.70
JoinMethod · 0.65
VersionMethod · 0.65

Tested by

no test coverage detected