Skip to content

Commit

Permalink
chore: properly rename MustUnmarshalClusterWorkflowTemplate (argopr…
Browse files Browse the repository at this point in the history
…oj#13431)

Signed-off-by: qingfeng777 <[email protected]>
  • Loading branch information
qingfeng777 authored and Joibel committed Sep 19, 2024
1 parent 53730e8 commit d8f11a6
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, r.(string), "no text to unmarshal")
}
}()
_ = 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 d8f11a6

Please sign in to comment.