Skip to content

Commit

Permalink
[frontend] Fill IsCron for proto of WorkflowExecutionInfo (cadence-wo…
Browse files Browse the repository at this point in the history
…rkflow#5366)

* [frontend] Fill IsCron for proto of WorkflowExecutionInfo
  • Loading branch information
3vilhamster authored Jul 27, 2023
1 parent 9b047cb commit 6961e8e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions common/types/mapper/proto/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4697,6 +4697,7 @@ func FromWorkflowExecutionInfo(t *types.WorkflowExecutionInfo) *apiv1.WorkflowEx
AutoResetPoints: FromResetPoints(t.AutoResetPoints),
TaskList: t.TaskList,
PartitionConfig: t.PartitionConfig,
IsCron: t.IsCron,
}
}

Expand All @@ -4721,6 +4722,7 @@ func ToWorkflowExecutionInfo(t *apiv1.WorkflowExecutionInfo) *types.WorkflowExec
AutoResetPoints: ToResetPoints(t.AutoResetPoints),
TaskList: t.TaskList,
PartitionConfig: t.PartitionConfig,
IsCron: t.IsCron,
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/types/mapper/proto/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ func TestParentExecutionInfoFields(t *testing.T) {
assert.Equal(t, testdata.ParentExecutionInfo.InitiatedID, *ToParentInitiatedID(info))
}
func TestWorkflowExecutionInfo(t *testing.T) {
for _, item := range []*types.WorkflowExecutionInfo{nil, {}, &testdata.WorkflowExecutionInfo} {
for _, item := range []*types.WorkflowExecutionInfo{nil, {}, &testdata.WorkflowExecutionInfo, &testdata.CronWorkflowExecutionInfo} {
assert.Equal(t, item, ToWorkflowExecutionInfo(FromWorkflowExecutionInfo(item)))
}
}
Expand Down
19 changes: 19 additions & 0 deletions common/types/testdata/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,25 @@ var (
TaskList: TaskListName,
PartitionConfig: PartitionConfig,
}
CronWorkflowExecutionInfo = types.WorkflowExecutionInfo{
Execution: &WorkflowExecution,
Type: &WorkflowType,
StartTime: &Timestamp1,
CloseTime: &Timestamp2,
CloseStatus: &WorkflowExecutionCloseStatus,
HistoryLength: HistoryLength,
ParentDomainID: common.StringPtr(DomainID),
ParentDomain: common.StringPtr(DomainName),
ParentExecution: &WorkflowExecution,
ParentInitiatedID: common.Int64Ptr(EventID1),
ExecutionTime: &Timestamp3,
Memo: &Memo,
SearchAttributes: &SearchAttributes,
AutoResetPoints: &ResetPoints,
TaskList: TaskListName,
PartitionConfig: PartitionConfig,
IsCron: true,
}
WorkflowExecutionInfoArray = []*types.WorkflowExecutionInfo{&WorkflowExecutionInfo}

WorkflowQuery = types.WorkflowQuery{
Expand Down

0 comments on commit 6961e8e

Please sign in to comment.