Skip to content

Commit 8852a80

Browse files
authored
IWF-532: Close integration test workflows when finished (#540)
1 parent 5b9db14 commit 8852a80

6 files changed

+42
-0
lines changed

integ/persistence_loading_policy_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ func doTestPersistenceLoadingPolicy(
158158
"S2_start": 1,
159159
"S2_decide": 1,
160160
}, history, "persistence loading policy test fail, %v", history)
161+
162+
// Terminate the workflow once tests completed
163+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
164+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
165+
WorkflowId: wfId,
166+
StopType: iwfidl.TERMINATE.Ptr(),
167+
}).Execute()
161168
}
162169

163170
func getSearchAttributesToGetFromMemo(loadingType iwfidl.PersistenceLoadingType) []iwfidl.SearchAttributeKeyAndType {

integ/set_data_attributes_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,11 @@ func TestSetDataAttributesTemporal(t *testing.T) {
8080
failTestAtHttpError(err, httpRespGet, t)
8181

8282
assertions.ElementsMatch(smallDataObjects, getResult.Objects)
83+
84+
// Terminate the workflow once tests completed
85+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
86+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
87+
WorkflowId: wfId,
88+
StopType: iwfidl.TERMINATE.Ptr(),
89+
}).Execute()
8390
}

integ/set_search_attributes_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,11 @@ func TestSetSearchAttributes(t *testing.T) {
9797
failTestAtHttpError(err, httpRespGet, t)
9898

9999
assertions.ElementsMatch(signalVals, searchResult.SearchAttributes)
100+
101+
// Terminate the workflow once tests completed
102+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
103+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
104+
WorkflowId: wfId,
105+
StopType: iwfidl.TERMINATE.Ptr(),
106+
}).Execute()
100107
}

integ/start_with_no_options_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,11 @@ func doTestStartWorkflowWithoutStartOptions(t *testing.T, backendType service.Ba
7474
assertions := assert.New(t)
7575
attribute := response.SearchAttributes[service.SearchAttributeIwfWorkflowType]
7676
assertions.Equal(basic.WorkflowType, attribute.GetStringValue())
77+
78+
// Terminate the workflow once tests completed
79+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
80+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
81+
WorkflowId: wfId,
82+
StopType: iwfidl.TERMINATE.Ptr(),
83+
}).Execute()
7784
}

integ/wf_state_options_data_attributes_loading_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,11 @@ func doTestWfStateOptionsDataAttributesLoading(
9090
"S5_start": 1,
9191
"S5_decide": 1,
9292
}, history, "state options data attributes loading, %v", history)
93+
94+
// Terminate the workflow once tests completed
95+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
96+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
97+
WorkflowId: wfId,
98+
StopType: iwfidl.TERMINATE.Ptr(),
99+
}).Execute()
93100
}

integ/wf_state_options_search_attributes_loading_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,11 @@ func doTestWfStateOptionsSearchAttributesLoading(
9090
"S5_start": 1,
9191
"S5_decide": 1,
9292
}, history, "state options search attributes loading, %v", history)
93+
94+
// Terminate the workflow once tests completed
95+
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
96+
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
97+
WorkflowId: wfId,
98+
StopType: iwfidl.TERMINATE.Ptr(),
99+
}).Execute()
93100
}

0 commit comments

Comments
 (0)