(t *testing.T, targetBlockVersion string)
| 781 | } |
| 782 | |
| 783 | func testCompactWithConfig(t *testing.T, targetBlockVersion string) { |
| 784 | tempDir := t.TempDir() |
| 785 | |
| 786 | _, w, c, err := New(&Config{ |
| 787 | Backend: backend.Local, |
| 788 | Pool: &pool.Config{ |
| 789 | MaxWorkers: 10, |
| 790 | QueueDepth: 100, |
| 791 | }, |
| 792 | Local: &local.Config{ |
| 793 | Path: path.Join(tempDir, "traces"), |
| 794 | }, |
| 795 | Block: &common.BlockConfig{ |
| 796 | BloomFP: .01, |
| 797 | BloomShardSizeBytes: 100_000, |
| 798 | Version: targetBlockVersion, |
| 799 | }, |
| 800 | WAL: &wal.Config{ |
| 801 | Filepath: path.Join(tempDir, "wal"), |
| 802 | }, |
| 803 | BlocklistPoll: 0, |
| 804 | }, nil, log.NewNopLogger()) |
| 805 | require.NoError(t, err) |
| 806 | |
| 807 | ctx := context.Background() |
| 808 | |
| 809 | blocks := cutTestBlocks(t, w, testTenantID, 10, 10) |
| 810 | metas := make([]*backend.BlockMeta, 0) |
| 811 | for _, b := range blocks { |
| 812 | metas = append(metas, b.BlockMeta()) |
| 813 | } |
| 814 | |
| 815 | _, err = c.CompactWithConfig( |
| 816 | ctx, |
| 817 | metas, |
| 818 | testTenantID, |
| 819 | &CompactorConfig{ |
| 820 | MaxCompactionRange: 24 * time.Hour, |
| 821 | BlockRetention: 0, |
| 822 | CompactedBlockRetention: 0, |
| 823 | MaxCompactionObjects: 1000, |
| 824 | MaxBlockBytes: 100_000_000, // Needs to be sized appropriately for the test data |
| 825 | }, |
| 826 | &mockSharder{}, |
| 827 | &mockOverrides{}, |
| 828 | ) |
| 829 | require.NoError(t, err) |
| 830 | } |
| 831 | |
| 832 | type testData struct { |
| 833 | id common.ID |
no test coverage detected