Skip to content

Commit

Permalink
Fix breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Oct 4, 2024
1 parent 69d5d2d commit c57c51c
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
11 changes: 11 additions & 0 deletions integration/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

func must[T any](v T, err error) T {
if err != nil {
panic(err)
Expand Down
11 changes: 11 additions & 0 deletions pkg/compactor/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2380,6 +2380,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

type bucketWithMockedAttributes struct {
objstore.Bucket

Expand Down
12 changes: 12 additions & 0 deletions pkg/storegateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/tsdb"
"github.com/prometheus/prometheus/tsdb/chunkenc"
"github.com/prometheus/prometheus/tsdb/chunks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -1670,6 +1671,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

func defaultLimitsConfig() validation.Limits {
limits := validation.Limits{}
flagext.DefaultValues(&limits)
Expand Down
11 changes: 11 additions & 0 deletions tools/tsdb-chunks/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

func must[T any](v T, err error) T {
if err != nil {
panic(err)
Expand Down
11 changes: 11 additions & 0 deletions tools/tsdb-index-health/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

func must[T any](v T, err error) T {
if err != nil {
panic(err)
Expand Down
11 changes: 11 additions & 0 deletions tools/tsdb-print-chunk/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ func (s sample) Type() chunkenc.ValueType {
}
}

func (s sample) Copy() chunks.Sample {
c := sample{t: s.t, v: s.v}
if s.h != nil {
c.h = s.h.Copy()
}
if s.fh != nil {
c.fh = s.fh.Copy()
}
return c
}

func must[T any](v T, err error) T {
if err != nil {
panic(err)
Expand Down

0 comments on commit c57c51c

Please sign in to comment.