Skip to content

Commit

Permalink
change do task to sync task
Browse files Browse the repository at this point in the history
Signed-off-by: Future Outlier <[email protected]>
  • Loading branch information
Future Outlier committed Dec 19, 2023
1 parent 790b3d5 commit 5e9ca09
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import (
pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks"
webapiPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks"
"github.com/flyteorg/flyte/flyteplugins/tests"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/storage"
)

func TestDo(t *testing.T) {
func TestSyncTask(t *testing.T) {
tCtx := getTaskContext(t)
taskReader := new(pluginCoreMocks.TaskReader)

Expand All @@ -39,7 +40,6 @@ func TestDo(t *testing.T) {
plugin, err := pluginEntry.LoadPlugin(context.TODO(), newFakeSetupContext("create_task_sync_test"))
assert.NoError(t, err)

// Call the Do function by Flavor
inputs, err := coreutils.MakeLiteralMap(map[string]interface{}{"x": 1})
assert.NoError(t, err)
basePrefix := storage.DataReference("fake://bucket/prefix/")
Expand All @@ -49,10 +49,8 @@ func TestDo(t *testing.T) {
inputReader.OnGetMatch(mock.Anything).Return(inputs, nil)
tCtx.OnInputReader().Return(inputReader)

phase, err := plugin.Handle(context.TODO(), tCtx)

assert.Nil(t, err)
assert.Equal(t, pluginsCore.PhaseSuccess, phase.Info().Phase())
phase := tests.RunPluginEndToEndTest(t, plugin, &template, inputs, nil, nil, nil)
assert.Equal(t, true, phase.Phase().IsSuccess())
}

func TestPlugin(t *testing.T) {
Expand Down

0 comments on commit 5e9ca09

Please sign in to comment.