Skip to content

Commit

Permalink
rollout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-crespo-fdc committed Oct 4, 2024
1 parent e523451 commit ccd9713
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions services/rollout-service/pkg/versions/versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ type mockOverviewStreamMessage struct {

type mockOverviewClient struct {
grpc.ClientStream
Responses map[string]*api.GetOverviewResponse
LastMetadata metadata.MD
StartStep chan struct{}
Steps chan step
savedStep *step
current int
Responses map[string]*api.GetOverviewResponse
AppDetailsResponses map[string]*api.GetAppDetailsResponse
LastMetadata metadata.MD
StartStep chan struct{}
Steps chan step
savedStep *step
current int
}

// GetOverview implements api.OverviewServiceClient
Expand All @@ -81,6 +82,15 @@ func (m *mockOverviewClient) GetOverview(ctx context.Context, in *api.GetOvervie
return nil, status.Error(codes.Unknown, "no")
}

// GetOverview implements api.GetAppDetails
func (m *mockOverviewClient) GetAppDetails(ctx context.Context, in *api.GetAppDetailsRequest, opts ...grpc.CallOption) (*api.GetAppDetailsResponse, error) {
m.LastMetadata, _ = metadata.FromOutgoingContext(ctx)
if resp := m.AppDetailsResponses[in.AppName]; resp != nil {
return resp, nil
}
return nil, status.Error(codes.Unknown, "no")
}

// StreamOverview implements api.OverviewServiceClient
func (m *mockOverviewClient) StreamOverview(ctx context.Context, in *api.GetOverviewRequest, opts ...grpc.CallOption) (api.OverviewService_StreamOverviewClient, error) {
m.StartStep <- struct{}{}
Expand Down

0 comments on commit ccd9713

Please sign in to comment.