@@ -23,8 +23,8 @@ func TestContainerPool(t *testing.T) {
2323 funcs := []string {"inc" , "double" }
2424 for _ , name := range funcs {
2525 fn , err := InitializePyFunction (name , "handler" , function .NewSignature ().
26- AddInput ("input " , function.Int {}).
27- AddOutput ("result " , function.Int {}).
26+ AddInput ("n " , function.Int {}).
27+ AddOutput ("n " , function.Int {}).
2828 Build ())
2929 utils .AssertNil (t , err )
3030
@@ -36,7 +36,7 @@ func TestContainerPool(t *testing.T) {
3636 for i := 0 ; i < n ; i ++ {
3737 for _ , name := range funcs {
3838 x := make (map [string ]interface {})
39- x ["input " ] = 1
39+ x ["n " ] = 1
4040 fnName := name
4141 go func () {
4242 time .Sleep (50 * time .Millisecond )
@@ -70,8 +70,8 @@ func TestCreateWorkflow(t *testing.T) {
7070 }
7171
7272 fn , err := InitializePyFunction ("inc" , "handler" , function .NewSignature ().
73- AddInput ("input " , function.Int {}).
74- AddOutput ("result " , function.Int {}).
73+ AddInput ("n " , function.Int {}).
74+ AddOutput ("n " , function.Int {}).
7575 Build ())
7676 utils .AssertNilMsg (t , err , "failed to initialize function" )
7777 wflow , err := CreateSequenceWorkflow (fn , fn , fn )
@@ -99,8 +99,8 @@ func TestInvokeWorkflow(t *testing.T) {
9999 }
100100 fcName := "sequence"
101101 fn , err := initializeJsFunction ("inc" , function .NewSignature ().
102- AddInput ("input " , function.Int {}).
103- AddOutput ("result " , function.Int {}).
102+ AddInput ("n " , function.Int {}).
103+ AddOutput ("n " , function.Int {}).
104104 Build ())
105105 utils .AssertNilMsg (t , err , "failed to initialize function" )
106106 wflow , err := CreateSequenceWorkflow (fn , fn , fn )
@@ -114,7 +114,7 @@ func TestInvokeWorkflow(t *testing.T) {
114114
115115 // === this is the test ===
116116 params := make (map [string ]interface {})
117- params ["input " ] = 1
117+ params ["n " ] = 1
118118 invokeWorkflowApiTest (t , params , fcName , HOST , PORT , false )
119119
120120 // here we do not use REST API
@@ -133,13 +133,13 @@ func TestInvokeWorkflow_DifferentFunctions(t *testing.T) {
133133 }
134134 fcName := "sequence"
135135 fnJs , err := initializeJsFunction ("inc" , function .NewSignature ().
136- AddInput ("input " , function.Int {}).
137- AddOutput ("result " , function.Int {}).
136+ AddInput ("n " , function.Int {}).
137+ AddOutput ("n " , function.Int {}).
138138 Build ())
139139 utils .AssertNilMsg (t , err , "failed to initialize javascript function" )
140140 fnPy , err := InitializePyFunction ("double" , "handler" , function .NewSignature ().
141- AddInput ("input " , function.Int {}).
142- AddOutput ("result " , function.Int {}).
141+ AddInput ("n " , function.Int {}).
142+ AddOutput ("n " , function.Int {}).
143143 Build ())
144144 utils .AssertNilMsg (t , err , "failed to initialize python function" )
145145 wflow , err := CreateSequenceWorkflow (fnPy , fnJs , fnPy , fnJs )
@@ -153,7 +153,7 @@ func TestInvokeWorkflow_DifferentFunctions(t *testing.T) {
153153
154154 // === this is the test ===
155155 params := make (map [string ]interface {})
156- params ["input " ] = 1
156+ params ["n " ] = 1
157157 invokeWorkflowApiTest (t , params , fcName , HOST , PORT , false )
158158
159159 // here we do not use REST API
@@ -172,16 +172,16 @@ func TestDeleteWorkflow(t *testing.T) {
172172 }
173173 fcName := "sequence"
174174 fn , err := InitializePyFunction ("inc" , "handler" , function .NewSignature ().
175- AddInput ("input " , function.Int {}).
176- AddOutput ("result " , function.Int {}).
175+ AddInput ("n " , function.Int {}).
176+ AddOutput ("n " , function.Int {}).
177177 Build ())
178178 if err != nil {
179179 fmt .Printf ("inc creation failed: %v\n " , err )
180180 t .Fail ()
181181 }
182182 db , err := InitializePyFunction ("double" , "handler" , function .NewSignature ().
183- AddInput ("input " , function.Int {}).
184- AddOutput ("result " , function.Int {}).
183+ AddInput ("n " , function.Int {}).
184+ AddOutput ("n " , function.Int {}).
185185 Build ())
186186 utils .AssertNilMsg (t , err , "failed to initialize function" )
187187 wflow , err := CreateSequenceWorkflow (fn , db , fn )
@@ -212,8 +212,8 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
212212 fcName := "sequence"
213213
214214 fn , err := InitializePyFunction ("inc" , "handler" , function .NewSignature ().
215- AddInput ("input " , function.Int {}).
216- AddOutput ("result " , function.Int {}).
215+ AddInput ("n " , function.Int {}).
216+ AddOutput ("n " , function.Int {}).
217217 Build ())
218218 utils .AssertNilMsg (t , err , "failed to initialize function" )
219219 wflow , err := CreateSequenceWorkflow (fn , fn , fn )
@@ -227,7 +227,7 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
227227
228228 // === this is the test ===
229229 params := make (map [string ]interface {})
230- params ["input " ] = 1
230+ params ["n " ] = 1
231231 invocationResult := invokeWorkflowApiTest (t , params , fcName , HOST , PORT , true )
232232
233233 reqIdStruct := & function.AsyncResponse {}
@@ -251,7 +251,7 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
251251 i ++
252252 time .Sleep (200 * time .Millisecond )
253253 } else {
254- utils .AssertEquals (t , 4 , cast .ToInt (response .Result ["result " ]))
254+ utils .AssertEquals (t , 4 , cast .ToInt (response .Result ["n " ]))
255255 break
256256 }
257257 }
0 commit comments