@@ -145,11 +145,11 @@ func BackendTest(t *testing.T, setup func() TestBackend, teardown func(b TestBac
145
145
require .NotNil (t , tk )
146
146
147
147
// Complete workflow task
148
- err = b .CompleteWorkflowTask (ctx , tk , wfi , backend . WorkflowStateActive , tk .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
148
+ err = b .CompleteWorkflowTask (ctx , tk , wfi , core . WorkflowInstanceStateActive , tk .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
149
149
require .NoError (t , err )
150
150
151
151
// Task is already completed, this should error
152
- err = b .CompleteWorkflowTask (ctx , tk , wfi , backend . WorkflowStateActive , tk .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
152
+ err = b .CompleteWorkflowTask (ctx , tk , wfi , core . WorkflowInstanceStateActive , tk .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
153
153
require .Error (t , err )
154
154
},
155
155
},
@@ -185,7 +185,7 @@ func BackendTest(t *testing.T, setup func() TestBackend, teardown func(b TestBac
185
185
186
186
workflowEvents := []history.WorkflowEvent {}
187
187
188
- err = b .CompleteWorkflowTask (ctx , task , wfi , backend . WorkflowStateActive , events , activityEvents , []history.Event {}, workflowEvents )
188
+ err = b .CompleteWorkflowTask (ctx , task , wfi , core . WorkflowInstanceStateActive , events , activityEvents , []history.Event {}, workflowEvents )
189
189
require .NoError (t , err )
190
190
191
191
time .Sleep (time .Second )
@@ -228,15 +228,15 @@ func BackendTest(t *testing.T, setup func() TestBackend, teardown func(b TestBac
228
228
events [i ].SequenceID = sequenceID
229
229
}
230
230
231
- err = b .CompleteWorkflowTask (ctx , task , wfi , backend . WorkflowStateFinished , events , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
231
+ err = b .CompleteWorkflowTask (ctx , task , wfi , core . WorkflowInstanceStateFinished , events , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
232
232
require .NoError (t , err )
233
233
234
234
time .Sleep (time .Second )
235
235
236
236
db := b .(diag.Backend )
237
237
s , err := db .GetWorkflowInstance (ctx , wfi .InstanceID )
238
238
require .NoError (t , err )
239
- require .Equal (t , backend . WorkflowStateFinished , s .State )
239
+ require .Equal (t , core . WorkflowInstanceStateFinished , s .State )
240
240
require .NotNil (t , s .CompletedAt )
241
241
},
242
242
},
@@ -290,7 +290,7 @@ func BackendTest(t *testing.T, setup func() TestBackend, teardown func(b TestBac
290
290
// Simulate context and sub-workflow cancellation
291
291
task , err := b .GetWorkflowTask (ctx )
292
292
require .NoError (t , err )
293
- err = b .CompleteWorkflowTask (ctx , task , instance , backend . WorkflowStateActive , task .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {
293
+ err = b .CompleteWorkflowTask (ctx , task , instance , core . WorkflowInstanceStateActive , task .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {
294
294
{
295
295
WorkflowInstance : subInstance1 ,
296
296
HistoryEvent : history .NewHistoryEvent (1 , time .Now (), history .EventType_WorkflowExecutionCanceled , & history.SubWorkflowCancellationRequestedAttributes {
@@ -344,6 +344,6 @@ func startWorkflow(t *testing.T, ctx context.Context, b backend.Backend, c clien
344
344
require .NoError (t , err )
345
345
346
346
err = b .CompleteWorkflowTask (
347
- ctx , task , instance , backend . WorkflowStateActive , task .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
347
+ ctx , task , instance , core . WorkflowInstanceStateActive , task .NewEvents , []history.Event {}, []history.Event {}, []history.WorkflowEvent {})
348
348
require .NoError (t , err )
349
349
}
0 commit comments