Skip to content

Commit

Permalink
Add memo to DescribeWorkflowExecutionResponse (#2454)
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu authored and Wenquan Xing committed Aug 27, 2019
1 parent 4f00346 commit ae63ef7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions host/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ func (s *elasticsearchIntegrationSuite) TestListWorkflow_SearchAttribute() {
}
// verify upsert data is on ES
s.testListResultForUpsertSearchAttributes(listRequest)

// verify DescribeWorkflowExecution
descRequest := &workflow.DescribeWorkflowExecutionRequest{
Domain: common.StringPtr(s.domainName),
Execution: &workflow.WorkflowExecution{
WorkflowId: common.StringPtr(id),
},
}
descResp, err := s.engine.DescribeWorkflowExecution(createContext(), descRequest)
s.Nil(err)
expectedSearchAttributes := getUpsertSearchAttributes()
s.Equal(expectedSearchAttributes, descResp.WorkflowExecutionInfo.GetSearchAttributes())
}

func (s *elasticsearchIntegrationSuite) TestListWorkflow_PageToken() {
Expand Down
9 changes: 9 additions & 0 deletions host/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3720,6 +3720,15 @@ func (s *integrationSuite) startWithMemoHelper(startFn startFunc, id string, tas
startdEventAttributes := firstEvent.WorkflowExecutionStartedEventAttributes
s.Equal(memo, startdEventAttributes.Memo)

// verify DescribeWorkflowExecution result
descRequest := &workflow.DescribeWorkflowExecutionRequest{
Domain: common.StringPtr(s.domainName),
Execution: execution,
}
descResp, err := s.engine.DescribeWorkflowExecution(createContext(), descRequest)
s.Nil(err)
s.Equal(memo, descResp.WorkflowExecutionInfo.Memo)

// verify closed visibility
var closdExecutionInfo *workflow.WorkflowExecutionInfo
for i := 0; i < 10; i++ {
Expand Down
1 change: 1 addition & 0 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ func (e *historyEngineImpl) DescribeWorkflowExecution(
StartTime: common.Int64Ptr(executionInfo.StartTimestamp.UnixNano()),
HistoryLength: common.Int64Ptr(msBuilder.GetNextEventID() - common.FirstEventID),
AutoResetPoints: executionInfo.AutoResetPoints,
Memo: &workflow.Memo{Fields: executionInfo.Memo},
SearchAttributes: &workflow.SearchAttributes{IndexedFields: executionInfo.SearchAttributes},
},
}
Expand Down

0 comments on commit ae63ef7

Please sign in to comment.