-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nikki/docs/flyte-docs-overhaul
- Loading branch information
Showing
19 changed files
with
358 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
flytepropeller/pkg/compiler/transformers/k8s/inputs_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
package k8s | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" | ||
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" | ||
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" | ||
) | ||
|
||
func TestValidateInputs_InvalidLiteralType(t *testing.T) { | ||
nodeID := common.NodeID("test-node") | ||
|
||
iface := &core.TypedInterface{ | ||
Inputs: &core.VariableMap{ | ||
Variables: map[string]*core.Variable{ | ||
"input1": { | ||
Type: &core.LiteralType{ | ||
Type: &core.LiteralType_Simple{ | ||
Simple: 1000, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
inputs := core.LiteralMap{ | ||
Literals: map[string]*core.Literal{ | ||
"input1": nil, // Set this to nil to trigger the nil case | ||
}, | ||
} | ||
|
||
errs := errors.NewCompileErrors() | ||
ok := validateInputs(nodeID, iface, inputs, errs) | ||
|
||
assert.False(t, ok) | ||
assert.True(t, errs.HasErrors()) | ||
|
||
idlNotFound := false | ||
var errMsg string | ||
for _, err := range errs.Errors().List() { | ||
if err.Code() == "InvalidLiteralType" { | ||
idlNotFound = true | ||
errMsg = err.Error() | ||
break | ||
} | ||
} | ||
assert.True(t, idlNotFound, "Expected InvalidLiteralType error was not found in errors") | ||
|
||
expectedContainedErrorMsg := "Failed to validate literal type" | ||
assert.Contains(t, errMsg, expectedContainedErrorMsg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.