Skip to content

Commit

Permalink
Nested conditionals in compiler #minor (flyteorg#203)
Browse files Browse the repository at this point in the history
* Nested conditionals in compiler

Signed-off-by: Ketan Umare <[email protected]>

* updated

Signed-off-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 authored Jun 3, 2021
1 parent a042066 commit 821d232
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 50 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/flyteorg/flyteidl v0.18.50
github.com/flyteorg/flyteplugins v0.5.38
github.com/flyteorg/flytepropeller v0.7.8
github.com/flyteorg/flyteplugins v0.5.49
github.com/flyteorg/flytepropeller v0.10.16
github.com/flyteorg/flytestdlib v0.3.22
github.com/ghodss/yaml v1.0.0
github.com/gofrs/uuid v4.0.0+incompatible // indirect
Expand Down
20 changes: 7 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
Expand Down Expand Up @@ -304,15 +303,15 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flyteorg/flyteidl v0.18.17/go.mod h1:b5Fq4Z8a5b0mF6pEwTd48ufvikUGVkWSjZiMT0ZtqKI=
github.com/flyteorg/flyteidl v0.18.24/go.mod h1:b5Fq4Z8a5b0mF6pEwTd48ufvikUGVkWSjZiMT0ZtqKI=
github.com/flyteorg/flyteidl v0.18.48/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
github.com/flyteorg/flyteidl v0.18.50 h1:L1fMj6QEXoKin+cPQn9sfwJ1x14tlChdz1mG1WaaIW4=
github.com/flyteorg/flyteidl v0.18.50/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
github.com/flyteorg/flyteplugins v0.5.38 h1:xAQ1J23cRxzwNDgzbmRuuvflq2PFetntRCjuM5RBfTw=
github.com/flyteorg/flyteplugins v0.5.38/go.mod h1:CxerBGWWEmNYmPxSMHnwQEr9cc1Fbo/g5fcABazU6Jo=
github.com/flyteorg/flytepropeller v0.7.8 h1:O441kDHJUayS/2rebTj7VG4e1LowrweazQhzTaZ97m4=
github.com/flyteorg/flytepropeller v0.7.8/go.mod h1:2SPJtYS0oM5lN4OCqBDbSRozRWvobFTXXlAC2ygbbWk=
github.com/flyteorg/flyteplugins v0.5.49 h1:jqmNrsTQ2+m+vYKqDVNO3CYy9q3XYTms3XzOr3roAT0=
github.com/flyteorg/flyteplugins v0.5.49/go.mod h1:567WIA0Rr6QjmXsqvGsU+Cyb57Ia6qzddxIw//RPwYk=
github.com/flyteorg/flytepropeller v0.10.16 h1:WSVh0X0F9xSw1BxGKbHqu0oha37YaBmO3bOS7GjR3Qo=
github.com/flyteorg/flytepropeller v0.10.16/go.mod h1:D0WDyXfNqk5Ee2SBckXMHm18KMzqSQDCIHgGjScQVGM=
github.com/flyteorg/flytestdlib v0.3.13/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220=
github.com/flyteorg/flytestdlib v0.3.17/go.mod h1:VlbQuHTE+z2N5qusfwi+6WEkeJoqr8Q0E4NtBAsdwkU=
github.com/flyteorg/flytestdlib v0.3.22 h1:nJEPaCdxzXBaeg2p4fdo3I3Ua09NedFRaUwuLafLEdw=
github.com/flyteorg/flytestdlib v0.3.22/go.mod h1:1XG0DwYTUm34Yrffm1Qy9Tdr/pWQypEqTq5dUxw3/cM=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
Expand Down Expand Up @@ -777,7 +776,6 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.12.2/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 h1:7xsUJsB2NrdcttQPa7JLEaGzvdbk7KvfrjgHZXOQRo0=
Expand Down Expand Up @@ -1159,7 +1157,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac h1:jWKYCNlX4J5s8M0nHYkh7Y7c9gRVDEb3mq51j5J0F5M=
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac/go.mod h1:hoLfEwdY11HjRfKFH6KqnPsfxlo3BP6bJehpDv8t6sQ=
github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
Expand Down Expand Up @@ -1534,7 +1531,6 @@ golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand Down Expand Up @@ -1880,7 +1876,6 @@ google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
Expand Down Expand Up @@ -1935,7 +1930,6 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
Expand Down Expand Up @@ -2004,7 +1998,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
Expand All @@ -2027,6 +2020,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
11 changes: 6 additions & 5 deletions pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"errors"
"testing"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"k8s.io/apimachinery/pkg/util/sets"

eventWriterMocks "github.com/flyteorg/flyteadmin/pkg/async/events/mocks"
Expand Down Expand Up @@ -47,7 +49,6 @@ import (
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"
"github.com/flyteorg/flytepropeller/pkg/utils"
mockScope "github.com/flyteorg/flytestdlib/promutils"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -477,7 +478,7 @@ func TestCreateExecutionInCompatibleInputs(t *testing.T) {
request := testutils.GetExecutionRequest()
request.Inputs = &core.LiteralMap{
Literals: map[string]*core.Literal{
"foo-1": utils.MustMakeLiteral("foo-value-1"),
"foo-1": coreutils.MustMakeLiteral("foo-value-1"),
},
}
response, err := execManager.CreateExecution(context.Background(), request, requestedAt)
Expand Down Expand Up @@ -559,10 +560,10 @@ func TestCreateExecutionVerifyDbModel(t *testing.T) {
if err := storageClient.ReadProtobuf(ctx, input.InputsURI, &inputs); err != nil {
return err
}
fooValue := utils.MustMakeLiteral("foo-value-1")
fooValue := coreutils.MustMakeLiteral("foo-value-1")
assert.Equal(t, 1, len(userInputs.Literals))
assert.EqualValues(t, userInputs.Literals["foo"], fooValue)
barValue := utils.MustMakeLiteral("bar-value")
barValue := coreutils.MustMakeLiteral("bar-value")
assert.Equal(t, len(inputs.Literals), 2)
assert.EqualValues(t, inputs.Literals["foo"], fooValue)
assert.EqualValues(t, inputs.Literals["bar"], barValue)
Expand Down Expand Up @@ -2271,7 +2272,7 @@ func TestRelaunchExecution_LegacyModel(t *testing.T) {
existingClosure := getLegacyClosure()
existingClosure.Phase = core.WorkflowExecution_RUNNING
existingClosure.StartedAt = startTimeProto
existingClosure.ComputedInputs.Literals["bar"] = utils.MustMakeLiteral("bar-value")
existingClosure.ComputedInputs.Literals["bar"] = coreutils.MustMakeLiteral("bar-value")
existingClosureBytes, _ := proto.Marshal(existingClosure)
executionGetFunc := makeLegacyExecutionGetFunc(t, existingClosureBytes, &startTime)
repository.ExecutionRepo().(*repositoryMocks.MockExecutionRepo).SetGetCallback(executionGetFunc)
Expand Down
5 changes: 3 additions & 2 deletions pkg/manager/impl/launch_plan_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"testing"
"time"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"github.com/flyteorg/flyteadmin/pkg/async/schedule/mocks"

scheduleInterfaces "github.com/flyteorg/flyteadmin/pkg/async/schedule/interfaces"
Expand All @@ -27,7 +29,6 @@ import (

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/utils"
mockScope "github.com/flyteorg/flytestdlib/promutils"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -299,7 +300,7 @@ func TestCreateLaunchPlanValidateCreate(t *testing.T) {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions pkg/manager/impl/testutils/mock_requests.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package testutils

import (
"github.com/flyteorg/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/utils"
"github.com/golang/protobuf/proto"
)

Expand Down Expand Up @@ -140,14 +140,14 @@ func GetLaunchPlanRequest() admin.LaunchPlanCreateRequest {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
},
FixedInputs: &core.LiteralMap{
Literals: map[string]*core.Literal{
"bar": utils.MustMakeLiteral("bar-value"),
"bar": coreutils.MustMakeLiteral("bar-value"),
},
},
},
Expand Down Expand Up @@ -214,7 +214,7 @@ func GetExecutionRequest() admin.ExecutionCreateRequest {
},
Inputs: &core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral("foo-value-1"),
"foo": coreutils.MustMakeLiteral("foo-value-1"),
},
},
}
Expand Down Expand Up @@ -255,14 +255,14 @@ func GetSampleLpSpecForTest() admin.LaunchPlanSpec {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
},
FixedInputs: &core.LiteralMap{
Literals: map[string]*core.Literal{
"bar": utils.MustMakeLiteral("bar-value"),
"bar": coreutils.MustMakeLiteral("bar-value"),
},
},
EntityMetadata: &admin.LaunchPlanMetadata{
Expand Down
21 changes: 11 additions & 10 deletions pkg/manager/impl/validation/execution_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"errors"
"testing"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/event"

"github.com/flyteorg/flyteadmin/pkg/manager/impl/testutils"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/utils"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -76,8 +77,8 @@ func TestGetExecutionInputs(t *testing.T) {
)
expectedMap := core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral("foo-value-1"),
"bar": utils.MustMakeLiteral("bar-value"),
"foo": coreutils.MustMakeLiteral("foo-value-1"),
"bar": coreutils.MustMakeLiteral("bar-value"),
},
}
assert.Nil(t, err)
Expand All @@ -90,7 +91,7 @@ func TestValidateExecInputsWrongType(t *testing.T) {
lpRequest := testutils.GetLaunchPlanRequest()
executionRequest.Inputs = &core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral(1),
"foo": coreutils.MustMakeLiteral(1),
},
}
_, err := CheckAndFetchInputsForExecution(
Expand All @@ -106,8 +107,8 @@ func TestValidateExecInputsExtraInputs(t *testing.T) {
lpRequest := testutils.GetLaunchPlanRequest()
executionRequest.Inputs = &core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral("foo-value-1"),
"foo-extra": utils.MustMakeLiteral("foo-value-1"),
"foo": coreutils.MustMakeLiteral("foo-value-1"),
"foo-extra": coreutils.MustMakeLiteral("foo-value-1"),
},
}
_, err := CheckAndFetchInputsForExecution(
Expand All @@ -123,8 +124,8 @@ func TestValidateExecInputsOverrideFixed(t *testing.T) {
lpRequest := testutils.GetLaunchPlanRequest()
executionRequest.Inputs = &core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral("foo-value-1"),
"bar": utils.MustMakeLiteral("bar-value"),
"foo": coreutils.MustMakeLiteral("foo-value-1"),
"bar": coreutils.MustMakeLiteral("bar-value"),
},
}
_, err := CheckAndFetchInputsForExecution(
Expand All @@ -146,8 +147,8 @@ func TestValidateExecEmptyInputs(t *testing.T) {
)
expectedMap := core.LiteralMap{
Literals: map[string]*core.Literal{
"foo": utils.MustMakeLiteral("foo-value"),
"bar": utils.MustMakeLiteral("bar-value"),
"foo": coreutils.MustMakeLiteral("foo-value"),
"bar": coreutils.MustMakeLiteral("bar-value"),
},
}
assert.Nil(t, err)
Expand Down
9 changes: 5 additions & 4 deletions pkg/manager/impl/validation/launch_plan_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"testing"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"github.com/flyteorg/flyteadmin/pkg/manager/impl/testutils"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/utils"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -73,7 +74,7 @@ func TestGetLpExpectedInputs(t *testing.T) {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down Expand Up @@ -231,7 +232,7 @@ func TestGetLpExpectedNoFixedInput(t *testing.T) {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down Expand Up @@ -339,7 +340,7 @@ func TestValidateSchedule_NoRequired(t *testing.T) {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions pkg/manager/impl/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package validation
import (
"testing"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"github.com/flyteorg/flyteadmin/pkg/common"
"github.com/flyteorg/flyteadmin/pkg/errors"
"github.com/flyteorg/flyteadmin/pkg/manager/impl/shared"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/utils"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
)
Expand Down Expand Up @@ -159,7 +160,7 @@ func TestValidateParameterMap(t *testing.T) {
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions pkg/workflowengine/impl/interface_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package impl
import (
"testing"

"github.com/flyteorg/flyteidl/clients/go/coreutils"

"github.com/flyteorg/flyteadmin/pkg/repositories/models"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flytepropeller/pkg/compiler/common"
"github.com/flyteorg/flytepropeller/pkg/utils"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
)
Expand All @@ -27,7 +28,7 @@ var inputs = core.ParameterMap{
Type: &core.LiteralType{Type: &core.LiteralType_Simple{Simple: core.SimpleType_STRING}},
},
Behavior: &core.Parameter_Default{
Default: utils.MustMakeLiteral("foo-value"),
Default: coreutils.MustMakeLiteral("foo-value"),
},
},
},
Expand Down
Loading

0 comments on commit 821d232

Please sign in to comment.