Skip to content

Commit

Permalink
IWF-532: Close integration test workflows when finished (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski authored Feb 6, 2025
1 parent 5b9db14 commit 8852a80
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integ/persistence_loading_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ func doTestPersistenceLoadingPolicy(
"S2_start": 1,
"S2_decide": 1,
}, history, "persistence loading policy test fail, %v", history)

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}

func getSearchAttributesToGetFromMemo(loadingType iwfidl.PersistenceLoadingType) []iwfidl.SearchAttributeKeyAndType {
Expand Down
7 changes: 7 additions & 0 deletions integ/set_data_attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,11 @@ func TestSetDataAttributesTemporal(t *testing.T) {
failTestAtHttpError(err, httpRespGet, t)

assertions.ElementsMatch(smallDataObjects, getResult.Objects)

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}
7 changes: 7 additions & 0 deletions integ/set_search_attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@ func TestSetSearchAttributes(t *testing.T) {
failTestAtHttpError(err, httpRespGet, t)

assertions.ElementsMatch(signalVals, searchResult.SearchAttributes)

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}
7 changes: 7 additions & 0 deletions integ/start_with_no_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,11 @@ func doTestStartWorkflowWithoutStartOptions(t *testing.T, backendType service.Ba
assertions := assert.New(t)
attribute := response.SearchAttributes[service.SearchAttributeIwfWorkflowType]
assertions.Equal(basic.WorkflowType, attribute.GetStringValue())

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}
7 changes: 7 additions & 0 deletions integ/wf_state_options_data_attributes_loading_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ func doTestWfStateOptionsDataAttributesLoading(
"S5_start": 1,
"S5_decide": 1,
}, history, "state options data attributes loading, %v", history)

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}
7 changes: 7 additions & 0 deletions integ/wf_state_options_search_attributes_loading_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ func doTestWfStateOptionsSearchAttributesLoading(
"S5_start": 1,
"S5_decide": 1,
}, history, "state options search attributes loading, %v", history)

// Terminate the workflow once tests completed
stopReq := apiClient.DefaultApi.ApiV1WorkflowStopPost(context.Background())
_, err = stopReq.WorkflowStopRequest(iwfidl.WorkflowStopRequest{
WorkflowId: wfId,
StopType: iwfidl.TERMINATE.Ptr(),
}).Execute()
}

0 comments on commit 8852a80

Please sign in to comment.