Skip to content

Commit

Permalink
chore: properly rename MustUnmarshalClusterWorkflowTemplate (#13431)
Browse files Browse the repository at this point in the history
Signed-off-by: qingfeng777 <[email protected]>
  • Loading branch information
qingfeng777 authored Aug 3, 2024
1 parent 902ddd4 commit b6d6403
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/workflow/v1alpha1/marshall.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func MustMarshallJSON(v interface{}) string {
return string(data)
}

func MustUnmarshalClusterWorkflow(text interface{}) *ClusterWorkflowTemplate {
func MustUnmarshalClusterWorkflowTemplate(text interface{}) *ClusterWorkflowTemplate {
x := &ClusterWorkflowTemplate{}
MustUnmarshal(text, &x)
return x
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/workflow/v1alpha1/marshall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"github.com/stretchr/testify/assert"
)

func TestMustUnmarshalClusterWorkflow(t *testing.T) {
func TestMustUnmarshalClusterWorkflowTemplate(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Fatalf("The code did not panic but should have")
} else {
assert.Equal(t, "no text to unmarshal", r.(string))
}
}()
_ = MustUnmarshalClusterWorkflow([]byte(""))
t.Fatalf("MustUnmarshalClusterWorkflow should have panicked and this part should not have been reached.")
_ = MustUnmarshalClusterWorkflowTemplate([]byte(""))
t.Fatalf("MustUnmarshalClusterWorkflowTemplate should have panicked and this part should not have been reached.")
}
2 changes: 1 addition & 1 deletion workflow/controller/operator_template_scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ spec:

func TestTemplateClusterScope(t *testing.T) {
wf := wfv1.MustUnmarshalWorkflow(testTemplateClusterScopeWorkflowYaml)
cwftmpl := wfv1.MustUnmarshalClusterWorkflow(testTemplateClusterScopeWorkflowTemplateYaml1)
cwftmpl := wfv1.MustUnmarshalClusterWorkflowTemplate(testTemplateClusterScopeWorkflowTemplateYaml1)
wftmpl := wfv1.MustUnmarshalWorkflowTemplate(testTemplateScopeWorkflowTemplateYaml2)

cancel, controller := newController(wf, cwftmpl, wftmpl)
Expand Down

0 comments on commit b6d6403

Please sign in to comment.