Skip to content

Commit

Permalink
Fix: make QuickSync no-op
Browse files Browse the repository at this point in the history
Signed-off-by: t-kikuc <[email protected]>
  • Loading branch information
t-kikuc committed Jan 26, 2025
1 parent 027e03c commit 574ae17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pkg/app/pipedv1/plugin/wait/deployment/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (s *deploymentServiceServer) BuildPipelineSyncStages(ctx context.Context, r
// BuildQuickSyncStages implements deployment.BuildQuickSyncStages.
func (s *deploymentServiceServer) BuildQuickSyncStages(ctx context.Context, request *deployment.BuildQuickSyncStagesRequest) (*deployment.BuildQuickSyncStagesResponse, error) {
return &deployment.BuildQuickSyncStagesResponse{
Stages: []*model.PipelineStage{newWaitStage()},
Stages: []*model.PipelineStage{},
}, nil
}

Expand Down
21 changes: 1 addition & 20 deletions pkg/app/pipedv1/plugin/wait/deployment/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,7 @@ func TestBuildQuickSyncStages(t *testing.T) {
t.Parallel()

expected := &deployment.BuildQuickSyncStagesResponse{
Stages: []*model.PipelineStage{
{
Id: "WAIT",
Name: "WAIT",
Desc: "Wait for the specified duration",
Rollback: false,
Status: model.StageStatus_STAGE_NOT_STARTED_YET,
},
},
Stages: []*model.PipelineStage{},
}

server := NewDeploymentService(nil, zap.NewNop(), nil)
Expand All @@ -73,17 +65,6 @@ func TestBuildQuickSyncStages(t *testing.T) {
Rollback: false,
})
assert.NoError(t, err)
resp.Stages[0].CreatedAt = 0 // Ignore timestamps
resp.Stages[0].UpdatedAt = 0
assert.Equal(t, resp, expected)

// The response will be the same even if Rollback is true.
resp, err = server.BuildQuickSyncStages(context.Background(), &deployment.BuildQuickSyncStagesRequest{
Rollback: true,
})
assert.NoError(t, err)
resp.Stages[0].CreatedAt = 0 // Ignore timestamps
resp.Stages[0].UpdatedAt = 0
assert.Equal(t, resp, expected)
}

Expand Down

0 comments on commit 574ae17

Please sign in to comment.