change: move step logs to session runner

This commit is contained in:
debugtalk
2022-03-31 12:11:18 +08:00
parent 78c272ef29
commit dff1255b94
7 changed files with 32 additions and 38 deletions

View File

@@ -243,8 +243,6 @@ func (r *requestBuilder) prepareBody(stepVariables map[string]interface{}) error
}
func runStepRequest(r *SessionRunner, step *TStep) (stepResult *StepResult, err error) {
log.Info().Str("step", step.Name).Msg("run step start")
stepResult = &StepResult{
Name: step.Name,
StepType: stepTypeRequest,
@@ -255,18 +253,8 @@ func runStepRequest(r *SessionRunner, step *TStep) (stepResult *StepResult, err
defer func() {
// update testcase summary
if err != nil {
log.Error().Err(err).Msg("run request step failed")
stepResult.Attachment = err.Error()
} else {
// update extracted variables
r.UpdateSession(stepResult.ExportVars)
log.Info().
Str("step", step.Name).
Bool("success", stepResult.Success).
Interface("exportVars", stepResult.ExportVars).
Msg("run step end")
}
r.UpdateSummary(stepResult)
}()
sessionData := newSessionData()