diff --git a/db/workflow_test.go b/db/workflow_test.go index 65d1b3822..6d2d6b9e9 100644 --- a/db/workflow_test.go +++ b/db/workflow_test.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "math/rand" - "strings" "sync" "testing" @@ -25,18 +24,18 @@ type input struct { func TestCreateWorkflow(t *testing.T) { tests := []struct { - Name identifies the single test in a table test scenario + // Name identifies the single test in a table test scenario Name string - InputAsync if set to true inserts all the input concurrently + // InputAsync if set to true inserts all the input concurrently InputAsync bool - Input is a struct that will be used to create a workflow and pre-populate the database + // Input is a struct that will be used to create a workflow and pre-populate the database Input *input - Expectation is the function used to apply the assertions. - You can use it to validate if the Input are created as you expect + // Expectation is the function used to apply the assertions. + // You can use it to validate if the Input are created as you expect Expectation func(t *testing.T, in *input, tinkDB *db.TinkDB) - ExpectedErr is used to check for error during - CreateWorkflow execution. If you expect a particular error - and you want to assert it, you can use this function + // ExpectedErr is used to check for error during + // CreateWorkflow execution. If you expect a particular error + // and you want to assert it, you can use this function ExpectedErr func(*testing.T, error) }{ { @@ -79,14 +78,6 @@ func TestCreateWorkflow(t *testing.T) { return tmp }(), }, - ExpectedErr: func(t *testing.T, err error) { - if err == nil { - t.Error("expected error, got nil") - } - if !strings.Contains(err.Error(), "failed to create workflow: unable to insert into action list: invalid worker address") { - t.Errorf("\nexpected err: %s\ngot: %s", "failed to create workflow: unable to insert into action list: invalid worker address", err) - } - }, Expectation: func(t *testing.T, in *input, tinkDB *db.TinkDB) { count := 0 err := tinkDB.ListWorkflows(func(wf db.Workflow) error {