Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev committed Oct 1, 2024
1 parent b5da246 commit 31b3aab
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ packages:
github.com/grafana/pyroscope/pkg/experiment/metastore/discovery:
interfaces:
Discovery:
github.com/grafana/pyroscope/pkg/experiment/metastore/dlq:
interfaces:
LocalServer:
5 changes: 3 additions & 2 deletions pkg/experiment/ingester/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"github.com/grafana/dskit/flagext"
"github.com/grafana/pyroscope/pkg/experiment/metastore"
"github.com/grafana/pyroscope/pkg/test/mocks/mockdlq"
"io"
"math/rand"
"path/filepath"
Expand Down Expand Up @@ -389,8 +390,8 @@ func TestDLQRecoveryMock(t *testing.T) {
assert.Len(t, allBlocks, 1)

recoveredMetas := make(chan *metastorev1.BlockMeta, 1)
srv := mockmetastorev1.NewMockMetastoreServiceServer(t)
srv.On("AddBlock", mock.Anything, mock.Anything).
srv := mockdlq.NewMockLocalServer(t)
srv.On("AddRecoveredBlock", mock.Anything, mock.Anything).
Once().
Run(func(args mock.Arguments) {
meta := args.Get(1).(*metastorev1.AddBlockRequest).Block
Expand Down
14 changes: 7 additions & 7 deletions pkg/experiment/metastore/dlq/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
typesv1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1"
segmentstorage "github.com/grafana/pyroscope/pkg/experiment/ingester/storage"
"github.com/grafana/pyroscope/pkg/objstore/providers/memory"
"github.com/grafana/pyroscope/pkg/test/mocks/mockmetastorev1"
"github.com/grafana/pyroscope/pkg/test/mocks/mockdlq"
"github.com/oklog/ulid"
"github.com/prometheus/prometheus/util/testutil"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -37,8 +37,8 @@ func TestRecoverTick(t *testing.T) {
}
actual := []*metastorev1.BlockMeta{}

srv := mockmetastorev1.NewMockMetastoreServiceServer(t)
srv.On("AddBlock", mock.Anything, mock.Anything).
srv := mockdlq.NewMockLocalServer(t)
srv.On("AddRecoveredBlock", mock.Anything, mock.Anything).
Times(3).
Run(func(args mock.Arguments) {
meta := args.Get(1).(*metastorev1.AddBlockRequest).Block
Expand Down Expand Up @@ -75,9 +75,9 @@ func TestNotRaftLeader(t *testing.T) {
},
}

srv := mockmetastorev1.NewMockMetastoreServiceServer(t)
srv := mockdlq.NewMockLocalServer(t)
s, _ := status.New(codes.Unavailable, "mock metastore error").WithDetails(&typesv1.RaftDetails{Leader: string("239")})
srv.On("AddBlock", mock.Anything, mock.Anything).
srv.On("AddRecoveredBlock", mock.Anything, mock.Anything).
Once().
Return(nil, s.Err())

Expand Down Expand Up @@ -110,8 +110,8 @@ func TestStartStop(t *testing.T) {
m := new(sync.Mutex)
actual := []*metastorev1.BlockMeta{}

srv := mockmetastorev1.NewMockMetastoreServiceServer(t)
srv.On("AddBlock", mock.Anything, mock.Anything).
srv := mockdlq.NewMockLocalServer(t)
srv.On("AddRecoveredBlock", mock.Anything, mock.Anything).
Times(3).
Run(func(args mock.Arguments) {
meta := args.Get(1).(*metastorev1.AddBlockRequest).Block
Expand Down
97 changes: 97 additions & 0 deletions pkg/test/mocks/mockdlq/mock_local_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31b3aab

Please sign in to comment.