Skip to content

Commit

Permalink
cleanup url blob set up in unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dittamo <[email protected]>
  • Loading branch information
pvditt committed Jan 12, 2024
1 parent db1aaad commit b85c172
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
11 changes: 0 additions & 11 deletions flyteadmin/pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -3595,17 +3594,7 @@ func TestGetExecutionData(t *testing.T) {
}, nil
}
mockExecutionRemoteURL := dataMocks.NewMockRemoteURL()
mockExecutionRemoteURL.(*dataMocks.MockRemoteURL).GetCallback = func(
ctx context.Context, uri string) (admin.UrlBlob, error) {
if strings.HasSuffix(uri, shared.Inputs) {
return admin.UrlBlob{
Url: "inputs",
Bytes: 200,
}, nil
}

return admin.UrlBlob{}, errors.New("unexpected input")
}
mockStorage := commonMocks.GetMockStorageClient()
fullInputs := &core.LiteralMap{
Literals: map[string]*core.Literal{
Expand Down
9 changes: 0 additions & 9 deletions flyteadmin/pkg/manager/impl/task_execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,16 +897,7 @@ func TestGetTaskExecutionData(t *testing.T) {
}, nil
})
mockTaskExecutionRemoteURL = dataMocks.NewMockRemoteURL()
mockTaskExecutionRemoteURL.(*dataMocks.MockRemoteURL).GetCallback = func(ctx context.Context, uri string) (admin.UrlBlob, error) {
if uri == "input-uri.pb" {
return admin.UrlBlob{
Url: "inputs",
Bytes: 100,
}, nil
}

return admin.UrlBlob{}, errors.New("unexpected input")
}
mockStorage := commonMocks.GetMockStorageClient()
fullInputs := &core.LiteralMap{
Literals: map[string]*core.Literal{
Expand Down
11 changes: 0 additions & 11 deletions flyteadmin/pkg/manager/impl/util/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/stretchr/testify/assert"

commonMocks "github.com/flyteorg/flyte/flyteadmin/pkg/common/mocks"
urlMocks "github.com/flyteorg/flyte/flyteadmin/pkg/data/mocks"
"github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces"
"github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
Expand All @@ -28,16 +27,6 @@ const testOutputsURI = "s3://foo/bar/outputs.pb"
func TestGetInputs(t *testing.T) {
inputsURI := "s3://foo/bar/inputs.pb"

expectedURLBlob := admin.UrlBlob{
Url: "s3://foo/signed/inputs.pb",
Bytes: 1000,
}

mockRemoteURL := urlMocks.NewMockRemoteURL()
mockRemoteURL.(*urlMocks.MockRemoteURL).GetCallback = func(ctx context.Context, uri string) (admin.UrlBlob, error) {
assert.Equal(t, inputsURI, uri)
return expectedURLBlob, nil
}
remoteDataConfig := interfaces.RemoteDataConfig{
MaxSizeInBytes: 2000,
}
Expand Down

0 comments on commit b85c172

Please sign in to comment.