@@ -67,9 +67,13 @@ func TestWorkflowSpecFormatChart(t *testing.T) {
67
67
{"notstreamssepolia" , notStreamSepoliaWorkflowSpec },
68
68
{"serial" , serialWorkflowSpec },
69
69
{"parallel" , parallelWorkflowSpec },
70
+ {"parallel_serialized" , parallelSerializedWorkflowSpec },
70
71
{"builder_parallel" , buildSimpleWorkflowSpec (
71
72
sdk .NewWorkflowSpecFactory (sdk.NewWorkflowParams {Owner : "test" , Name : "parallel" }),
72
73
).MustSpec (t )},
74
+ {"builder_serial" , buildSimpleWorkflowSpec (
75
+ sdk .NewSerialWorkflowSpecFactory (sdk.NewWorkflowParams {Owner : "test" , Name : "serial" }),
76
+ ).MustSpec (t )},
73
77
} {
74
78
t .Run (tt .name , func (t * testing.T ) {
75
79
requireEqualChart (t , tt .name , tt .workflow )
@@ -386,3 +390,86 @@ var parallelWorkflowSpec = sdk.WorkflowSpec{
386
390
},
387
391
},
388
392
}
393
+
394
+ var parallelSerializedWorkflowSpec = sdk.WorkflowSpec {
395
+ Name : "parallel-serialized" ,
396
+ Owner : "owner" ,
397
+ Triggers : []sdk.StepDefinition {
398
+ {
399
+
400
+ Ref : "trigger-chain-event" ,
401
+ Inputs : sdk.StepInputs {},
402
+ Config : map [string ]any {"maxFrequencyMs" : 5000 },
403
+ CapabilityType : capabilities .CapabilityTypeTrigger ,
404
+ },
405
+ },
406
+ Actions : []sdk.StepDefinition {
407
+ {
408
+
409
+ Ref : "get-foo" ,
410
+ Inputs : sdk.StepInputs {
411
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
412
+ },
413
+ CapabilityType : capabilities .CapabilityTypeAction ,
414
+ },
415
+ {
416
+
417
+ Ref : "compute-foo" ,
418
+ Inputs : sdk.StepInputs {
419
+ Mapping : map [string ]any {"Arg0" : "$(get-foo.outputs)" },
420
+ },
421
+ CapabilityType : capabilities .CapabilityTypeAction ,
422
+ },
423
+ {
424
+
425
+ Ref : "get-bar" ,
426
+ Condition : "$(compute-foo.success)" ,
427
+ Inputs : sdk.StepInputs {
428
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
429
+ },
430
+ CapabilityType : capabilities .CapabilityTypeAction ,
431
+ },
432
+ {
433
+
434
+ Ref : "compute-bar" ,
435
+ Inputs : sdk.StepInputs {
436
+ Mapping : map [string ]any {"Arg0" : "$(get-bar.outputs)" },
437
+ },
438
+ CapabilityType : capabilities .CapabilityTypeAction ,
439
+ },
440
+ {
441
+
442
+ Ref : "read-token-price" ,
443
+ Condition : "$(compute-bar.success)" ,
444
+ Inputs : sdk.StepInputs {
445
+ Mapping : map [string ]any {"Arg0" : "$(trigger-chain-event.outputs)" },
446
+ },
447
+ CapabilityType : capabilities .CapabilityTypeAction ,
448
+ },
449
+ },
450
+ Consensus : []sdk.StepDefinition {
451
+ {
452
+
453
+ Ref : "data-feeds-report" ,
454
+ Inputs : sdk.StepInputs {
455
+ Mapping : map [string ]any {
456
+ "observations" : []string {
457
+ "$(compute-foo.outputs.Value)" ,
458
+ "$(compute-bar.outputs.Value)" ,
459
+ },
460
+ "token_price" : "$(read-token-price.outputs.Value)" ,
461
+ },
462
+ },
463
+ CapabilityType : capabilities .CapabilityTypeConsensus ,
464
+ },
465
+ },
466
+ Targets : []sdk.StepDefinition {
467
+ {
468
+
469
+ Inputs : sdk.StepInputs {
470
+ Mapping : map [string ]any {"signed_report" : "$(data-feeds-report.outputs)" },
471
+ },
472
+ CapabilityType : capabilities .CapabilityTypeTarget ,
473
+ },
474
+ },
475
+ }
0 commit comments