Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
  • Loading branch information
gauravgahlot committed Dec 31, 2020
1 parent b28934f commit 171a706
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions db/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"math/rand"
"strings"
"sync"
"testing"

Expand All @@ -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)
}{
{
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 171a706

Please sign in to comment.