Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
dimitarvdimitrov committed Mar 7, 2025
1 parent b64eecf commit d6e1503
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion integration/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package integration
import (
"context"
"encoding/json"
"fmt"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -133,7 +134,7 @@ func TestCompactBlocksContainingNativeHistograms(t *testing.T) {
chkReader, err := chunks.NewDirReader(filepath.Join(outDir, blockID, block.ChunksDirname), nil)
require.NoError(t, err)

ixReader, err := index.NewFileReader(filepath.Join(outDir, blockID, block.IndexFilename), index.DecodePostingsRaw)
ixReader, err := index.NewFileReader(filepath.Join(outDir, blockID, block.IndexFilename), index.DecodePostingsRaw, emptyStats{})
require.NoError(t, err)

n, v := index.AllPostingsKey()
Expand Down Expand Up @@ -190,6 +191,21 @@ func TestCompactBlocksContainingNativeHistograms(t *testing.T) {
require.Equal(t, expectedSeries, compactedSeries)
}

type emptyStats struct {
}

func (e emptyStats) TotalSeries() int64 {
return 0
}

func (e emptyStats) LabelValuesCount(context.Context, string) (int64, error) {
return 0, fmt.Errorf("not implemented")
}

func (e emptyStats) LabelValuesCardinality(context.Context, string, ...string) (int64, error) {
return 0, fmt.Errorf("not implemented")
}

func isMarkedForDeletionDueToCompaction(t *testing.T, blockPath string) bool {
deletionMarkFilePath := filepath.Join(blockPath, block.DeletionMarkFilename)
b, err := os.ReadFile(deletionMarkFilePath)
Expand Down

0 comments on commit d6e1503

Please sign in to comment.