Skip to content

Commit

Permalink
IWF-472: Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski committed Jan 28, 2025
1 parent 4c447d5 commit 3456615
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions integ/wf_state_api_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ import (
"github.com/indeedeng/iwf/service"
"github.com/indeedeng/iwf/service/common/ptr"
"github.com/stretchr/testify/assert"
"net/http"
"strconv"
"strings"
"testing"
"time"
)

func panicAtHttpError(err error, httpResp *http.Response) {
if err != nil {
panic(err)
}
if httpResp.StatusCode != http.StatusOK {
panic("Status not success" + httpResp.Status)
}
}

func TestStateApiTimeoutTemporal(t *testing.T) {
if !*temporalIntegTest {
t.Skip()
Expand Down Expand Up @@ -72,14 +82,16 @@ func doTestStateApiTimeout(t *testing.T, backendType service.BackendType, config
WorkflowConfigOverride: config,
},
}).Execute()
failTestAtHttpError(err, httpResp, t)
// failTestAtHttpError(err, httpResp, t)
panicAtHttpError(err, httpResp)

// wait for the workflow
reqWait := apiClient.DefaultApi.ApiV1WorkflowGetWithWaitPost(context.Background())
resp, httpResp, err := reqWait.WorkflowGetRequest(iwfidl.WorkflowGetRequest{
WorkflowId: wfId,
}).Execute()
failTestAtHttpError(err, httpResp, t)
// failTestAtHttpError(err, httpResp, t)
panicAtHttpError(err, httpResp)

history, _ := wfHandler.GetTestResult()
assertions := assert.New(t)
Expand Down
4 changes: 2 additions & 2 deletions integ/workflow/wf_state_api_timeout/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func (h *handler) ApiV1WorkflowStateStart(c *gin.Context, t *testing.T) {
return
}
}
fmt.Println(
fmt.Sprintf("WorkflowType: %v", req.GetWorkflowType()),
fmt.Printf(
"WorkflowType: %v", req.GetWorkflowType(),
)
helpers.FailTestWithErrorMessage("should not get here", t)
}
Expand Down

0 comments on commit 3456615

Please sign in to comment.