mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 00:09:37 +08:00
fix: failed to generate html report while running demo_ref_testcase.yml #1237
This commit is contained in:
@@ -86,8 +86,6 @@ func (r *SessionRunner) Start() error {
|
|||||||
for k, v := range stepResult.ExportVars {
|
for k, v := range stepResult.ExportVars {
|
||||||
r.sessionVariables[k] = v
|
r.sessionVariables[k] = v
|
||||||
}
|
}
|
||||||
// update testcase summary
|
|
||||||
r.updateSummary(stepResult)
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("step", stepResult.Name).
|
Str("step", stepResult.Name).
|
||||||
@@ -101,19 +99,6 @@ func (r *SessionRunner) Start() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateSummary appends step result to summary
|
|
||||||
func (r *SessionRunner) updateSummary(stepResult *StepResult) {
|
|
||||||
r.summary.Records = append(r.summary.Records, stepResult)
|
|
||||||
r.summary.Stat.Total += 1
|
|
||||||
if stepResult.Success {
|
|
||||||
r.summary.Stat.Successes += 1
|
|
||||||
} else {
|
|
||||||
r.summary.Stat.Failures += 1
|
|
||||||
// update summary result to failed
|
|
||||||
r.summary.Success = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MergeStepVariables merges step variables with config variables and session variables
|
// MergeStepVariables merges step variables with config variables and session variables
|
||||||
func (r *SessionRunner) MergeStepVariables(vars map[string]interface{}) (map[string]interface{}, error) {
|
func (r *SessionRunner) MergeStepVariables(vars map[string]interface{}) (map[string]interface{}, error) {
|
||||||
// override variables
|
// override variables
|
||||||
|
|||||||
@@ -378,6 +378,17 @@ func runStepRequest(r *SessionRunner, step *TStep) (stepResult *StepResult, err
|
|||||||
stepResult.ContentSize = resp.ContentLength
|
stepResult.ContentSize = resp.ContentLength
|
||||||
stepResult.Data = sessionData
|
stepResult.Data = sessionData
|
||||||
|
|
||||||
|
// update summary
|
||||||
|
r.summary.Records = append(r.summary.Records, stepResult)
|
||||||
|
r.summary.Stat.Total += 1
|
||||||
|
if stepResult.Success {
|
||||||
|
r.summary.Stat.Successes += 1
|
||||||
|
} else {
|
||||||
|
r.summary.Stat.Failures += 1
|
||||||
|
// update summary result to failed
|
||||||
|
r.summary.Success = false
|
||||||
|
}
|
||||||
|
|
||||||
return stepResult, err
|
return stepResult, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user