(t *testing.T, blocklistPoll time.Duration, opts ...testConfigOption)
| 43 | type testConfigOption func(*Config) |
| 44 | |
| 45 | func 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 | |
| 77 | func TestDB(t *testing.T) { |
| 78 | r, w, c, _ := testConfig(t, 0) |
no test coverage detected