Skip to content

Commit

Permalink
[chore] [exporterhelper] Remove redundant Marshal methods from test s…
Browse files Browse the repository at this point in the history
…tructs (#8286)

The method was removed from the Request interface in
#8178, so
the implementation on the test structs is not required anymore
dmitryax authored Aug 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 26c150c commit 92f5fe6
Showing 2 changed files with 1 addition and 16 deletions.
7 changes: 1 addition & 6 deletions exporter/exporterhelper/internal/persistent_storage_test.go
Original file line number Diff line number Diff line change
@@ -62,11 +62,6 @@ func newFakeTracesRequest(td ptrace.Traces) *fakeTracesRequest {
}
}

func (fd *fakeTracesRequest) Marshal() ([]byte, error) {
marshaler := &ptrace.ProtoMarshaler{}
return marshaler.MarshalTraces(fd.td)
}

func (fd *fakeTracesRequest) OnProcessingFinished() {
if fd.processingFinishedCallback != nil {
fd.processingFinishedCallback()
@@ -480,7 +475,7 @@ func TestPersistentStorage_StorageFull(t *testing.T) {
var err error
traces := newTraces(5, 10)
req := newFakeTracesRequest(traces)
marshaled, err := req.Marshal()
marshaled, err := newFakeTracesRequestMarshalerFunc()(req)
require.NoError(t, err)
maxSizeInBytes := len(marshaled) * 5 // arbitrary small number
freeSpaceInBytes := 1
10 changes: 0 additions & 10 deletions exporter/exporterhelper/queued_retry_test.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ import (
"go.opentelemetry.io/collector/extension/extensiontest"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/obsreport/obsreporttest"
"go.opentelemetry.io/collector/pdata/ptrace"
)

func mockRequestUnmarshaler(mr *mockRequest) internal.RequestUnmarshaler {
@@ -650,10 +649,6 @@ func (mer *mockErrorRequest) OnError(error) internal.Request {
return mer
}

func (mer *mockErrorRequest) Marshal() ([]byte, error) {
return nil, nil
}

func (mer *mockErrorRequest) Count() int {
return 7
}
@@ -685,11 +680,6 @@ func (m *mockRequest) Export(ctx context.Context) error {
return ctx.Err()
}

func (m *mockRequest) Marshal() ([]byte, error) {
marshaler := &ptrace.ProtoMarshaler{}
return marshaler.MarshalTraces(ptrace.NewTraces())
}

func (m *mockRequest) OnError(error) internal.Request {
return &mockRequest{
baseRequest: m.baseRequest,

0 comments on commit 92f5fe6

Please sign in to comment.