Skip to content

Commit

Permalink
Fix mpi test
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Graetz <[email protected]>
  • Loading branch information
fg91 committed Jun 16, 2024
1 parent 2e54f69 commit dfc44b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mpi
import (
"context"
"fmt"
"reflect"
"testing"
"time"

Expand Down Expand Up @@ -170,6 +171,19 @@ func dummyMPITaskContext(taskTemplate *core.TaskTemplate, resources *corev1.Reso
taskExecutionMetadata.OnGetPlatformResources().Return(&corev1.ResourceRequirements{})
taskExecutionMetadata.OnGetEnvironmentVariables().Return(nil)
taskCtx.OnTaskExecutionMetadata().Return(taskExecutionMetadata)

inputState := k8s.PluginState{}
pluginStateReaderMock := mocks.PluginStateReader{}
pluginStateReaderMock.On("Get", mock.AnythingOfType(reflect.TypeOf(&inputState).String())).Return(
func(v interface{}) uint8 {
*(v.(*k8s.PluginState)) = inputState
return 0
},
func(v interface{}) error {
return nil
})

taskCtx.OnPluginStateReader().Return(&pluginStateReaderMock)
return taskCtx
}

Expand Down

0 comments on commit dfc44b4

Please sign in to comment.