Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fixes now that server has been upgraded #162

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/integration_tests/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestRetryNotFound(t *testing.T) {
assert.Error(t, err, "Retry is expected to return an error")

if swaggerErr, ok := err.(client.GenericSwaggerError); ok {
assert.Equal(t, 500, swaggerErr.StatusCode()) //TODO on test server update, should be a 404
assert.Equal(t, 404, swaggerErr.StatusCode())
} else {
assert.Fail(t, "err is not of type GenericSwaggerError")
}
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestUpdateTaskByRefName(t *testing.T) {
err := executor.UpdateTaskByRefName("task_ref", notFoundWorkflowId, model.CompletedTask, map[string]interface{}{})
assert.Error(t, err, "UpdateTaskByRefName is expected to return an error")
if swaggerErr, ok := err.(client.GenericSwaggerError); ok {
assert.Equal(t, 500, swaggerErr.StatusCode()) //TODO on test server update, should be a 404
assert.Equal(t, 404, swaggerErr.StatusCode())
} else {
assert.Fail(t, "err is not of type GenericSwaggerError")
}
Expand Down
21 changes: 19 additions & 2 deletions test/integration_tests/workflow_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
const retryLimit = 5

func TestWorkflowCreation(t *testing.T) {
executor := testdata.WorkflowExecutor
workflow := testdata.NewKitchenSinkWorkflow(testdata.WorkflowExecutor)
err := workflow.Register(true)
if err != nil {
Expand All @@ -31,9 +32,25 @@ func TestWorkflowCreation(t *testing.T) {
if err != nil {
t.Fatalf("Failed to complete the workflow, reason: %s", err)
}

assert.NotEmpty(t, run, "Workflow is null", run)
assert.Equal(t, string(model.CompletedWorkflow), run.Status)
assert.Equal(t, "input1", run.Input["key1"])

timeout := time.After(60 * time.Second)
tick := time.Tick(1 * time.Second)
workflowId := run.WorkflowId
for {
select {
case <-timeout:
t.Fatalf("Timed out and workflow %s didn't complete", workflowId)
case <-tick:
wf, err := executor.GetWorkflow(workflowId, false)
assert.NoError(t, err)
assert.Equal(t, model.CompletedWorkflow, wf.Status)
assert.Equal(t, "input1", run.Input["key1"])
return
}
}

}

func TestRemoveWorkflow(t *testing.T) {
Expand Down