Skip to content

Commit

Permalink
More unit-tests for cli:admin_commands.go
Browse files Browse the repository at this point in the history
Testing 3 more functions to bump code-coverage of the file to 30%
  • Loading branch information
dkrotx committed Oct 30, 2024
1 parent 40003fc commit 13871ac
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 17 deletions.
8 changes: 5 additions & 3 deletions tools/cli/admin_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func AdminRefreshWorkflowTasks(c *cli.Context) error {
if err != nil {
return commoncli.Problem("Refresh workflow task failed", err)
}
fmt.Println("Refresh workflow task succeeded.")
fmt.Fprintln(getDeps(c).Output(), "Refresh workflow task succeeded.")
return nil
}

Expand Down Expand Up @@ -737,7 +737,8 @@ func AdminResetQueue(c *cli.Context) error {
if err != nil {
return commoncli.Problem("Failed to reset queue", err)
}
fmt.Println("Reset queue state succeeded")

fmt.Fprintln(getDeps(c).Output(), "Reset queue state succeeded")
return nil
}

Expand Down Expand Up @@ -777,8 +778,9 @@ func AdminDescribeQueue(c *cli.Context) error {
return commoncli.Problem("Failed to describe queue", err)
}

output := getDeps(c).Output()
for _, state := range resp.ProcessingQueueStates {
fmt.Println(state)
fmt.Fprintln(output, state)
}
return nil
}
Loading

0 comments on commit 13871ac

Please sign in to comment.