Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
More fixes for testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
tnsetting committed Feb 2, 2021
1 parent 3e44470 commit 33ed060
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestCreateExecution(t *testing.T) {

mockConfig := getMockExecutionsConfigProvider()
mockConfig.(*runtimeMocks.MockConfigurationProvider).AddQualityOfServiceConfiguration(qosProvider)
execManager := NewExecutionManager(repository, mockConfig, getMockStorageForExecTest(context.Background()), mockExecutor, mockScope.NewTestScope(), mockScope.NewTestScope(), &mockPublisher, mockExecutionRemoteURL, nil, nil, nil)
execManager := NewExecutionManager(repository, mockConfig, getMockStorageForExecTest(context.Background()), mockExecutor, mockScope.NewTestScope(), mockScope.NewTestScope(), &mockPublisher, mockExecutionRemoteURL, nil, nil, &mockPublisher)
request := testutils.GetExecutionRequest()
request.Spec.Metadata = &admin.ExecutionMetadata{
Principal: "unused - populated from authenticated context",
Expand Down
11 changes: 7 additions & 4 deletions pkg/manager/impl/node_execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ func TestCreateNodeEvent(t *testing.T) {
}, *input)
return nil
})
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, nil)
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(),
getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL,
&mockPublisher)
resp, err := nodeExecManager.CreateNodeEvent(context.Background(), request)
assert.Nil(t, err)
assert.NotNil(t, resp)
Expand Down Expand Up @@ -189,7 +191,8 @@ func TestCreateNodeEvent_Update(t *testing.T) {

return nil
})
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, nil)
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(),
getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, &mockPublisher)
resp, err := nodeExecManager.CreateNodeEvent(context.Background(), request)
assert.Nil(t, err)
assert.NotNil(t, resp)
Expand All @@ -202,7 +205,7 @@ func TestCreateNodeEvent_MissingExecution(t *testing.T) {
func(ctx context.Context, input interfaces.GetResourceInput) (models.Execution, error) {
return models.Execution{}, expectedErr
})
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, nil)
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, &mockPublisher)
resp, err := nodeExecManager.CreateNodeEvent(context.Background(), request)
assert.EqualError(t, err, "failed to get existing execution id: [project:\"project\""+
" domain:\"domain\" name:\"name\" ] with err: expected error")
Expand Down Expand Up @@ -334,7 +337,7 @@ func TestCreateNodeEvent_FirstEventIsTerminal(t *testing.T) {
func(ctx context.Context, input interfaces.GetNodeExecutionInput) (models.NodeExecution, error) {
return models.NodeExecution{}, flyteAdminErrors.NewFlyteAdminError(codes.NotFound, "foo")
})
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, nil)
nodeExecManager := NewNodeExecutionManager(repository, getMockExecutionsConfigProvider(), getMockStorageForExecTest(context.Background()), mockScope.NewTestScope(), mockNodeExecutionRemoteURL, &mockPublisher)
succeededRequest := admin.NodeExecutionEventRequest{
RequestId: "request id",
Event: &event.NodeExecutionEvent{
Expand Down

0 comments on commit 33ed060

Please sign in to comment.