mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: record all requests of testcase reference in boom mode
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# NOTE: Generated By hrp v4.1.4, DO NOT EDIT!
|
||||
# NOTE: Generated By hrp v4.1.5, DO NOT EDIT!
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -136,7 +136,20 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
|
||||
b.Boomer.ResetStartTime()
|
||||
})
|
||||
stepResult, err := step.Run(sessionRunner)
|
||||
// update step result name with parsed step name
|
||||
stepResult.Name = stepName
|
||||
// record requests result of the step if step type is testcase
|
||||
if stepResult.StepType == stepTypeTestCase && stepResult.Data != nil {
|
||||
// record requests of testcase step
|
||||
for _, result := range stepResult.Data.([]*StepResult) {
|
||||
if result.Success {
|
||||
b.RecordSuccess(string(result.StepType), result.Name, result.Elapsed, result.ContentSize)
|
||||
} else {
|
||||
b.RecordFailure(string(result.StepType), result.Name, result.Elapsed, result.Attachment)
|
||||
}
|
||||
}
|
||||
}
|
||||
// record step failure
|
||||
if err != nil {
|
||||
// step failed
|
||||
var elapsed int64
|
||||
@@ -157,7 +170,7 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
|
||||
continue
|
||||
}
|
||||
|
||||
// step success
|
||||
// record step success
|
||||
if stepResult.StepType == stepTypeTransaction {
|
||||
// transaction
|
||||
// FIXME: support nested transactions
|
||||
|
||||
@@ -74,12 +74,16 @@ func (s *requestStats) logTransaction(name string, success bool, responseTime in
|
||||
}
|
||||
|
||||
func (s *requestStats) logRequest(method, name string, responseTime int64, contentLength int64) {
|
||||
s.total.log(responseTime, contentLength)
|
||||
if method != "testcase" {
|
||||
s.total.log(responseTime, contentLength)
|
||||
}
|
||||
s.get(name, method).log(responseTime, contentLength)
|
||||
}
|
||||
|
||||
func (s *requestStats) logError(method, name, err string) {
|
||||
s.total.logFailures()
|
||||
if method != "testcase" {
|
||||
s.total.logFailures()
|
||||
}
|
||||
s.get(name, method).logFailures()
|
||||
|
||||
// store error in errors map
|
||||
|
||||
Reference in New Issue
Block a user