mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
Merge pull request #1238 from xucong053/bugfix-failed-to-gen-html-report
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 {
|
||||
r.sessionVariables[k] = v
|
||||
}
|
||||
// update testcase summary
|
||||
r.updateSummary(stepResult)
|
||||
|
||||
log.Info().
|
||||
Str("step", stepResult.Name).
|
||||
@@ -101,19 +99,6 @@ func (r *SessionRunner) Start() error {
|
||||
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
|
||||
func (r *SessionRunner) MergeStepVariables(vars map[string]interface{}) (map[string]interface{}, error) {
|
||||
// override variables
|
||||
|
||||
@@ -378,6 +378,17 @@ func runStepRequest(r *SessionRunner, step *TStep) (stepResult *StepResult, err
|
||||
stepResult.ContentSize = resp.ContentLength
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user