Skip to content

Commit

Permalink
fix: list selector test workflows and check for empty list (#6046)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin authored Nov 21, 2024
1 parent 6276c1c commit a30cf07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/tcl/testworkflow-toolkit/commands/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,22 @@ func NewExecuteCmd() *cobra.Command {
ui.Fail(errors.Wrap(err, "error listing test workflows using selector"))
}

if len(testWorkflowsList) > 0 {
ui.Info("List of test workflows found for selector specification:")
} else {
ui.Warn("No test workflows found for selector specification")
}

for _, item := range testWorkflowsList {
testWorkflowNames = append(testWorkflowNames, item.Name)
ui.Info("- " + item.Name)
}
}

if len((testWorkflowNames)) == 0 {
ui.Fail(errors.New("no test workflows to run"))
}

// Resolve the params
params, err := commontcl.GetParamsSpec(w.Matrix, w.Shards, w.Count, w.MaxCount, baseMachine)
if err != nil {
Expand Down

0 comments on commit a30cf07

Please sign in to comment.