Skip to content

Commit 5e43836

Browse files
committed
Update tests for new proto shapes
Signed-off-by: joshvanl <[email protected]>
1 parent 6a50bd9 commit 5e43836

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

client/worker_grpc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func (c *TaskHubGrpcClient) StartWorkItemListener(ctx context.Context, r *task.T
6060
}
6161
}()
6262
for {
63-
// TODO: Manage concurrency
6463
workItem, err := stream.Recv()
6564

6665
if err != nil {

tests/task_executor_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func Test_Executor_WaitForEventSchedulesTimer(t *testing.T) {
5454
executor := task.NewTaskExecutor(r)
5555
results, err := executor.ExecuteOrchestrator(ctx, iid, oldEvents, newEvents)
5656
require.NoError(t, err)
57-
require.Equal(t, 1, len(results.Response.Actions), "Expected a single action to be scheduled")
58-
createTimerAction := results.Response.Actions[0].GetCreateTimer()
57+
require.Equal(t, 1, len(results.Actions), "Expected a single action to be scheduled")
58+
createTimerAction := results.Actions[0].GetCreateTimer()
5959
require.NotNil(t, createTimerAction, "Expected the scheduled action to be a timer")
6060
require.WithinDuration(t, startEvent.Timestamp.AsTime().Add(timerDuration), createTimerAction.FireAt.AsTime(), 0)
6161
require.Equal(t, "MyEvent", createTimerAction.GetName())
@@ -109,5 +109,5 @@ func Test_Executor_SuspendStopsAllActions(t *testing.T) {
109109
// Execute the orchestrator function and expect to get back no actions
110110
results, err := executor.ExecuteOrchestrator(ctx, iid, oldEvents, newEvents)
111111
require.NoError(t, err)
112-
require.Empty(t, results.Response.Actions, "Suspended orchestrations should not have any actions")
112+
require.Empty(t, results.Actions, "Suspended orchestrations should not have any actions")
113113
}

tests/worker_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func Test_TryProcessSingleOrchestrationWorkItem_BasicFlow(t *testing.T) {
4646
},
4747
}
4848
state := &backend.OrchestrationRuntimeState{}
49-
result := &backend.ExecutionResults{Response: &protos.OrchestratorResponse{}}
49+
result := &protos.OrchestratorResponse{}
5050

5151
ctx, cancel := context.WithCancel(ctx)
5252
completed := atomic.Bool{}
@@ -116,16 +116,14 @@ func Test_TryProcessSingleOrchestrationWorkItem_ExecutionStartedAndCompleted(t *
116116

117117
// Return an execution completed action to simulate the completion of the orchestration (a no-op)
118118
resultValue := "done"
119-
result := &backend.ExecutionResults{
120-
Response: &protos.OrchestratorResponse{
121-
Actions: []*protos.OrchestratorAction{
122-
{
123-
Id: -1,
124-
OrchestratorActionType: &protos.OrchestratorAction_CompleteOrchestration{
125-
CompleteOrchestration: &protos.CompleteOrchestrationAction{
126-
OrchestrationStatus: protos.OrchestrationStatus_ORCHESTRATION_STATUS_COMPLETED,
127-
Result: wrapperspb.String(resultValue),
128-
},
119+
result := &protos.OrchestratorResponse{
120+
Actions: []*protos.OrchestratorAction{
121+
{
122+
Id: -1,
123+
OrchestratorActionType: &protos.OrchestratorAction_CompleteOrchestration{
124+
CompleteOrchestration: &protos.CompleteOrchestrationAction{
125+
OrchestrationStatus: protos.OrchestrationStatus_ORCHESTRATION_STATUS_COMPLETED,
126+
Result: wrapperspb.String(resultValue),
129127
},
130128
},
131129
},

0 commit comments

Comments
 (0)