Skip to content

Commit

Permalink
remove deprecated method
Browse files Browse the repository at this point in the history
Signed-off-by: Iaroslav Ciupin <[email protected]>
  • Loading branch information
iaroslav-ciupin committed Nov 28, 2023
1 parent 65f20f7 commit 012a5f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
50 changes: 0 additions & 50 deletions flyteadmin/pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,56 +619,6 @@ func TestCreateExecutionInCompatibleInputs(t *testing.T) {
assert.Nil(t, response)
}

func TestCreateExecution_CreateExecutionModelError(t *testing.T) {
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
mockExecutor.OnExecuteMatch(mock.Anything, mock.Anything, mock.Anything).Return(workflowengineInterfaces.ExecutionResponse{}, nil)
mockExecutor.OnID().Return("customMockExecutor")
r := plugins.NewRegistry()
r.RegisterDefault(plugins.PluginIDWorkflowExecutor, &mockExecutor)

qosProvider := &runtimeIFaceMocks.QualityOfServiceConfiguration{}
qosProvider.OnGetTierExecutionValues().Return(map[core.QualityOfService_Tier]core.QualityOfServiceSpec{
core.QualityOfService_HIGH: {
QueueingBudget: ptypes.DurationProto(10 * time.Minute),
},
core.QualityOfService_MEDIUM: {
QueueingBudget: ptypes.DurationProto(20 * time.Minute),
},
core.QualityOfService_LOW: {
QueueingBudget: ptypes.DurationProto(30 * time.Minute),
},
})

qosProvider.OnGetDefaultTiers().Return(map[string]core.QualityOfService_Tier{
"domain": core.QualityOfService_HIGH,
})

mockConfig := getMockExecutionsConfigProvider()
mockConfig.(*runtimeMocks.MockConfigurationProvider).AddQualityOfServiceConfiguration(qosProvider)

request := testutils.GetExecutionRequest()
request.Spec.Metadata = &admin.ExecutionMetadata{
Principal: "unused - populated from authenticated context",
}
request.Spec.RawOutputDataConfig = &admin.RawOutputDataConfig{OutputLocationPrefix: rawOutput}

identity, err := auth.NewIdentityContext("", principal, "", time.Now(), sets.NewString(), nil, nil)
assert.NoError(t, err)
ctx := identity.WithContext(context.Background())
execManager := NewExecutionManager(repository, r, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockScope.NewTestScope(), &mockPublisher, mockExecutionRemoteURL, nil, nil, nil, nil, &eventWriterMocks.WorkflowExecutionEventWriter{})
clockMock := clock.NewMock()
execManager.(*ExecutionManager)._clock = clockMock
clockMock.Set(time.Unix(253402300801, 0)) // date after 10000-01-01
expectedErr := flyteAdminErrors.NewFlyteAdminError(codes.Internal, "failed to serialize execution created at time")

response, err := execManager.CreateExecution(ctx, request, requestedAt)

assert.Equal(t, expectedErr, err)
assert.Empty(t, response)
}

func TestCreateExecutionPropellerFailure(t *testing.T) {
clusterAssignment := admin.ClusterAssignment{ClusterPoolName: "gpu"}
repository := getMockRepositoryForExecTest()
Expand Down
5 changes: 1 addition & 4 deletions flyteadmin/pkg/repositories/transformers/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ func CreateExecutionModel(input CreateExecutionModelInput) (*models.Execution, e
if err != nil {
return nil, flyteErrs.NewFlyteAdminErrorf(codes.Internal, "Failed to serialize execution spec: %v", err)
}
createdAt, err := ptypes.TimestampProto(input.CreatedAt)
if err != nil {
return nil, flyteErrs.NewFlyteAdminErrorf(codes.Internal, "failed to serialize execution created at time")
}
createdAt := timestamppb.New(input.CreatedAt)
closure := admin.ExecutionClosure{
Phase: input.Phase,
CreatedAt: createdAt,
Expand Down

0 comments on commit 012a5f7

Please sign in to comment.