Skip to content

Commit

Permalink
Add integration test (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu authored Jul 18, 2018
1 parent c4650a1 commit 1341820
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions host/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6142,6 +6142,53 @@ func (s *integrationSuite) TestSignalWithStartWorkflow() {
s.Equal(signalName, *signalEvent.WorkflowExecutionSignaledEventAttributes.SignalName)
s.Equal(signalInput, signalEvent.WorkflowExecutionSignaledEventAttributes.Input)
s.Equal(identity, *signalEvent.WorkflowExecutionSignaledEventAttributes.Identity)

// Assert visibility is correct
listOpenRequest := &workflow.ListOpenWorkflowExecutionsRequest{
Domain: common.StringPtr(s.domainName),
MaximumPageSize: common.Int32Ptr(100),
StartTimeFilter: &workflow.StartTimeFilter{
EarliestTime: common.Int64Ptr(0),
LatestTime: common.Int64Ptr(time.Now().UnixNano()),
},
ExecutionFilter: &workflow.WorkflowExecutionFilter{
WorkflowId: common.StringPtr(id),
},
}
listResp, err := s.engine.ListOpenWorkflowExecutions(createContext(), listOpenRequest)
s.NoError(err)
s.Equal(1, len(listResp.Executions))

// Terminate workflow execution and assert visibility is correct
err = s.engine.TerminateWorkflowExecution(createContext(), &workflow.TerminateWorkflowExecutionRequest{
Domain: common.StringPtr(s.domainName),
WorkflowExecution: &workflow.WorkflowExecution{
WorkflowId: common.StringPtr(id),
},
Reason: common.StringPtr("kill workflow"),
Details: nil,
Identity: common.StringPtr(identity),
})
s.Nil(err)

listResp, err = s.engine.ListOpenWorkflowExecutions(createContext(), listOpenRequest)
s.NoError(err)
s.Equal(0, len(listResp.Executions))

listClosedRequest := &workflow.ListClosedWorkflowExecutionsRequest{
Domain: common.StringPtr(s.domainName),
MaximumPageSize: common.Int32Ptr(100),
StartTimeFilter: &workflow.StartTimeFilter{
EarliestTime: common.Int64Ptr(0),
LatestTime: common.Int64Ptr(time.Now().UnixNano()),
},
ExecutionFilter: &workflow.WorkflowExecutionFilter{
WorkflowId: common.StringPtr(id),
},
}
listClosedResp, err := s.engine.ListClosedWorkflowExecutions(createContext(), listClosedRequest)
s.NoError(err)
s.Equal(1, len(listClosedResp.Executions))
}

func (s *integrationSuite) TestTransientDecisionTimeout() {
Expand Down

0 comments on commit 1341820

Please sign in to comment.