Skip to content

Commit

Permalink
test: refactor to use assert.NoError (#5230)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisislawatts authored May 29, 2024
1 parent d048444 commit 3ebfbd3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions cliv2/cmd/cliv2/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ func Test_CreateCommandsForWorkflowWithSubcommands(t *testing.T) {
workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))
workflowId1 := workflow.NewWorkflowIdentifier(v)
_, err := globalEngine.Register(workflowId1, workflowConfig, fn)
if err != nil {
t.Fatal(err)
}
assert.NoError(t, err)
}

_ = globalEngine.Init()
Expand Down Expand Up @@ -195,9 +193,7 @@ func Test_runMainWorkflow_unknownargs(t *testing.T) {
workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))
workflowId1 := workflow.NewWorkflowIdentifier(v)
_, err := globalEngine.Register(workflowId1, workflowConfig, fn)
if err != nil {
t.Fatal(err)
}
assert.NoError(t, err)
}

_ = globalEngine.Init()
Expand Down Expand Up @@ -356,9 +352,7 @@ func Test_runWorkflowAndProcessData(t *testing.T) {
workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))

_, err := globalEngine.Register(workflowId1, workflowConfig, outputFn)
if err != nil {
t.Fatal(err)
}
assert.NoError(t, err)

fn := func(invocation workflow.InvocationContext, input []workflow.Data) ([]workflow.Data, error) {
typeId := workflow.NewTypeIdentifier(invocation.GetWorkflowIdentifier(), "workflowData")
Expand All @@ -376,9 +370,7 @@ func Test_runWorkflowAndProcessData(t *testing.T) {

var d []byte
d, err = json.Marshal(testSummary)
if err != nil {
t.Fatal(err)
}
assert.NoError(t, err)

data := workflow.NewData(typeId, content_type.TEST_SUMMARY, d)
return []workflow.Data{
Expand Down

0 comments on commit 3ebfbd3

Please sign in to comment.