From a30cf077043fe9cbf014806cfe330b288192c4b1 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Thu, 21 Nov 2024 09:54:57 +0300 Subject: [PATCH] fix: list selector test workflows and check for empty list (#6046) Signed-off-by: Vladislav Sukhin --- cmd/tcl/testworkflow-toolkit/commands/execute.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/tcl/testworkflow-toolkit/commands/execute.go b/cmd/tcl/testworkflow-toolkit/commands/execute.go index ce47f57f83..d85e069fb0 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/execute.go +++ b/cmd/tcl/testworkflow-toolkit/commands/execute.go @@ -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 {