@@ -32,15 +32,23 @@ func CLIChecks(cliData api.CLIData, overrideBaseURL string, send func(tea.Msg))
3232 }
3333
3434 for i , step := range cliData .Steps {
35- // This is the magic of the initial message sent before executing the test
36- if step .CLICommand != nil {
35+ switch {
36+ case step .CLICommand != nil :
3737 send (messages.StartStepMsg {
3838 Description : step .Description ,
3939 CMD : step .CLICommand .Command ,
4040 TmdlQuery : step .CLICommand .StdoutFilterTmdl ,
4141 NoPenaltyOnFail : step .NoPenaltyOnFail ,
4242 })
43- } else if step .HTTPRequest != nil {
43+
44+ result := runCLICommand (* step .CLICommand , variables )
45+ result .JqOutputs = collectStdoutJqOutputs (* step .CLICommand , result )
46+ results [i ].CLICommandResult = & result
47+
48+ sendCLICommandResults (send , * step .CLICommand , result , i )
49+ handleSleep (step .CLICommand .SleepAfterMs , send )
50+
51+ case step .HTTPRequest != nil :
4452 fullURL := strings .Replace (step .HTTPRequest .Request .FullURL , api .BaseURLPlaceholder , baseURL , 1 )
4553 interpolatedURL := InterpolateVariables (fullURL , variables )
4654
@@ -50,18 +58,7 @@ func CLIChecks(cliData api.CLIData, overrideBaseURL string, send func(tea.Msg))
5058 Method : step .HTTPRequest .Request .Method ,
5159 NoPenaltyOnFail : step .NoPenaltyOnFail ,
5260 })
53- }
54-
55- switch {
56- case step .CLICommand != nil :
57- result := runCLICommand (* step .CLICommand , variables )
58- result .JqOutputs = collectStdoutJqOutputs (* step .CLICommand , result )
59- results [i ].CLICommandResult = & result
60-
61- sendCLICommandResults (send , * step .CLICommand , result , i )
62- handleSleep (step .CLICommand .SleepAfterMs , send )
6361
64- case step .HTTPRequest != nil :
6562 result := runHTTPRequest (client , baseURL , variables , * step .HTTPRequest )
6663 results [i ].HTTPRequestResult = & result
6764 sendHTTPRequestResults (send , * step .HTTPRequest , result , i )
0 commit comments