Skip to content

Commit

Permalink
feat: removed unused ut with code logic update
Browse files Browse the repository at this point in the history
  • Loading branch information
annielz committed Nov 15, 2024
1 parent 9982dd1 commit 49e61e4
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions modular/executor/executor_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,44 +546,6 @@ func TestExecuteModular_HandleGCObjectTask(t *testing.T) {
return e
},
},
{
name: "failed to get bucket by bucket name",
task: &gfsptask.GfSpGCObjectTask{
Task: &gfsptask.GfSpTask{},
CurrentBlockNumber: 0,
},
fn: func() *ExecuteModular {
e := setup(t)
ctrl := gomock.NewController(t)
m := gfspclient.NewMockGfSpClientAPI(ctrl)
waitingGCObjects := []*metadatatypes.Object{
{
ObjectInfo: &storagetypes.ObjectInfo{Id: sdkmath.NewUint(1)},
},
}
m.EXPECT().ListDeletedObjectsByBlockNumberRange(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(),
gomock.Any()).Return(waitingGCObjects, uint64(0), nil).Times(1)
m.EXPECT().ReportTask(gomock.Any(), gomock.Any()).Return(nil).Times(1)
m.EXPECT().GetBucketInfoByBucketName(gomock.Any(), gomock.Any()).Return(nil, mockErr).Times(1)
e.baseApp.SetGfSpClient(m)

m1 := consensus.NewMockConsensus(ctrl)
m1.EXPECT().QueryStorageParamsByTimestamp(gomock.Any(), gomock.Any()).Return(&storagetypes.Params{
VersionedParams: storagetypes.VersionedParams{MaxSegmentSize: 10}}, nil).Times(1)
m1.EXPECT().QuerySP(gomock.Any(), gomock.Any()).Return(&sptypes.StorageProvider{Id: 1}, nil).Times(1)
e.baseApp.SetConsensus(m1)

m2 := piecestore.NewMockPieceOp(ctrl)
m2.EXPECT().SegmentPieceCount(gomock.Any(), gomock.Any()).Return(uint32(1)).Times(1)
m2.EXPECT().SegmentPieceKey(gomock.Any(), gomock.Any(), gomock.Any()).Return("test").Times(1)
e.baseApp.SetPieceOp(m2)

m3 := piecestore.NewMockPieceStore(ctrl)
m3.EXPECT().DeletePiece(gomock.Any(), gomock.Any()).Return(nil).Times(1)
e.baseApp.SetPieceStore(m3)
return e
},
},
{
name: "failed to get global virtual group",
task: &gfsptask.GfSpGCObjectTask{
Expand Down

0 comments on commit 49e61e4

Please sign in to comment.