MCPcopy
hub / github.com/micro/go-micro / TestFlowStepsRunInOrder

Function TestFlowStepsRunInOrder

flow/steps_test.go:26–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestFlowStepsRunInOrder(t *testing.T) {
27 f := New("seq",
28 WithCheckpoint(StoreCheckpoint(store.NewMemoryStore(), "seq")),
29 Steps(appendStep("a"), appendStep("b"), appendStep("c")),
30 )
31 if err := f.Execute(context.Background(), ""); err != nil {
32 t.Fatalf("Execute: %v", err)
33 }
34 res := f.Results()
35 if len(res) != 1 || res[0].Answer != "a,b,c" {
36 t.Fatalf("steps ran out of order: %+v", res)
37 }
38}
39
40// A run that fails mid-way is persisted at the failing step and resumes
41// there — without re-running the completed steps.

Callers

nothing calls this directly

Calls 9

NewMemoryStoreFunction · 0.92
StepsFunction · 0.85
appendStepFunction · 0.85
ExecuteMethod · 0.80
ResultsMethod · 0.80
NewFunction · 0.70
WithCheckpointFunction · 0.70
StoreCheckpointFunction · 0.70
FatalfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…