diff --git a/integ/internalchannel_test.go b/integ/internalchannel_test.go index 49ee7cf3..3d44b805 100644 --- a/integ/internalchannel_test.go +++ b/integ/internalchannel_test.go @@ -12,8 +12,7 @@ import ( "time" ) -// TODO: Fix -func _TestInterStateWorkflowTemporal(t *testing.T) { +func TestInterStateWorkflowTemporal(t *testing.T) { if !*temporalIntegTest { t.Skip() } @@ -88,7 +87,8 @@ func doTestInterStateWorkflow(t *testing.T, backendType service.BackendType, con }, history, "interstate test fail, %v", history) assertions.Equal(iwfidl.COMPLETED, resp2.GetWorkflowStatus()) - assertions.Equal(1, len(resp2.GetResults())) + // State completions with empty output are ignored + assertions.Equal(0, len(resp2.GetResults())) assertions.Equal(map[string]interface{}{ interstate.State21 + "received": interstate.TestVal1, interstate.State31 + "received": interstate.TestVal2, diff --git a/integ/locking_test.go b/integ/locking_test.go index 6d32dd68..fffd4777 100644 --- a/integ/locking_test.go +++ b/integ/locking_test.go @@ -16,8 +16,7 @@ import ( "github.com/stretchr/testify/assert" ) -// TODO: Fix -func _TestLockingWorkflowTemporal(t *testing.T) { +func TestLockingWorkflowTemporal(t *testing.T) { if !*temporalIntegTest { t.Skip() } @@ -27,8 +26,7 @@ func _TestLockingWorkflowTemporal(t *testing.T) { } } -// TODO: Fix -func _TestLockingWorkflowTemporalContinueAsNew(t *testing.T) { +func TestLockingWorkflowTemporalContinueAsNew(t *testing.T) { if !*temporalIntegTest { t.Skip() } @@ -200,7 +198,6 @@ func doTestLockingWorkflow(t *testing.T, backendType service.BackendType, config s2StartsDecides := locking.InParallelS2 + rpcIncrease // locking.InParallelS2 original state executions, and a new trigger from rpc finalCounterValue := int64(locking.InParallelS2 + 2*rpcIncrease) - stateCompletionCount := locking.InParallelS2 + rpcIncrease + 1 history, _ := wfHandler.GetTestResult() assertions.Equalf(map[string]int64{ "S1_start": 1, @@ -212,7 +209,8 @@ func doTestLockingWorkflow(t *testing.T, backendType service.BackendType, config }, history, "locking.test fail, %v", history) assertions.Equal(iwfidl.COMPLETED, resp2.GetWorkflowStatus()) - assertions.Equal(stateCompletionCount, len(resp2.GetResults())) + // State completions with empty output are ignored + assertions.Equal(0, len(resp2.GetResults())) reqSearch := apiClient.DefaultApi.ApiV1WorkflowSearchattributesGetPost(context.Background()) searchResult2, httpResp, err := reqSearch.WorkflowGetSearchAttributesRequest(iwfidl.WorkflowGetSearchAttributesRequest{ diff --git a/integ/wf_state_execute_api_fail_and_proceed_test.go b/integ/wf_state_execute_api_fail_and_proceed_test.go index a97f3ab2..177f7909 100644 --- a/integ/wf_state_execute_api_fail_and_proceed_test.go +++ b/integ/wf_state_execute_api_fail_and_proceed_test.go @@ -13,8 +13,7 @@ import ( "github.com/stretchr/testify/assert" ) -// TODO: Fix -func _TestStateExecuteApiFailAndProceedTemporal(t *testing.T) { +func TestStateExecuteApiFailAndProceedTemporal(t *testing.T) { if !*temporalIntegTest { t.Skip() } @@ -104,11 +103,7 @@ func doTestStateExecuteApiFailAndProceed(t *testing.T, backendType service.Backe assertions.Equalf(&iwfidl.WorkflowGetResponse{ WorkflowRunId: startResp.GetWorkflowRunId(), WorkflowStatus: iwfidl.COMPLETED, - Results: []iwfidl.StateCompletionOutput{ - { - CompletedStateId: wf_execute_api_fail_and_proceed.StateRecover, - CompletedStateExecutionId: wf_execute_api_fail_and_proceed.StateRecover + "-1", - }, - }, + // State completions with empty output are ignored + Results: []iwfidl.StateCompletionOutput(nil), }, resp, "response not expected") } diff --git a/integ/wf_state_wait_until_api_fail_and_proceed_test.go b/integ/wf_state_wait_until_api_fail_and_proceed_test.go index 784b6e73..45140c72 100644 --- a/integ/wf_state_wait_until_api_fail_and_proceed_test.go +++ b/integ/wf_state_wait_until_api_fail_and_proceed_test.go @@ -13,8 +13,7 @@ import ( "github.com/stretchr/testify/assert" ) -// TODO: Fix -func _TestStateApiFailAndProceedTemporal(t *testing.T) { +func TestStateApiFailAndProceedTemporal(t *testing.T) { if !*temporalIntegTest { t.Skip() } @@ -103,11 +102,7 @@ func doTestStateApiFailAndProceed(t *testing.T, backendType service.BackendType, assertions.Equalf(&iwfidl.WorkflowGetResponse{ WorkflowRunId: startResp.GetWorkflowRunId(), WorkflowStatus: iwfidl.COMPLETED, - Results: []iwfidl.StateCompletionOutput{ - { - CompletedStateId: wf_state_api_fail_and_proceed.State1, - CompletedStateExecutionId: wf_state_api_fail_and_proceed.State1 + "-1", - }, - }, + // State completions with empty output are ignored + Results: []iwfidl.StateCompletionOutput(nil), }, resp, "response not expected") } diff --git a/service/interpreter/outputCollector.go b/service/interpreter/outputCollector.go index daa3bd58..10da70cd 100644 --- a/service/interpreter/outputCollector.go +++ b/service/interpreter/outputCollector.go @@ -7,22 +7,11 @@ type OutputCollector struct { } func NewOutputCollector(initOutputs []iwfidl.StateCompletionOutput) *OutputCollector { - filteredOutputs := []iwfidl.StateCompletionOutput{} - if initOutputs == nil { - return &OutputCollector{ - outputs: filteredOutputs, - } - } else { - for _, output := range initOutputs { - if output.CompletedStateOutput != nil { - filteredOutputs = append(filteredOutputs, output) - } - } - - return &OutputCollector{ - outputs: filteredOutputs, - } + initOutputs = []iwfidl.StateCompletionOutput{} + } + return &OutputCollector{ + outputs: initOutputs, } }