refactor: TestCase/TestCaseDef/StepConfig models

This commit is contained in:
lilong.129
2024-11-09 20:15:40 +08:00
parent 2587bbee82
commit 8846e84d19
31 changed files with 621 additions and 563 deletions
+4 -3
View File
@@ -357,7 +357,7 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
startTime := time.Now()
for _, step := range testcase.TestSteps {
// parse step struct
err = sessionRunner.parseStepStruct(step)
err = sessionRunner.parseStep(step)
if err != nil {
log.Error().Err(err).Msg("parse step struct failed")
}
@@ -406,8 +406,9 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
if stepResult.StepType == stepTypeTransaction {
// transaction
// FIXME: support nested transactions
if step.Struct().Transaction.Type == transactionEnd { // only record when transaction ends
b.RecordTransaction(step.Struct().Transaction.Name, transactionSuccess, stepResult.Elapsed, 0)
stepTransaction := step.(*StepTransaction)
if stepTransaction.Transaction.Type == transactionEnd { // only record when transaction ends
b.RecordTransaction(stepTransaction.Name(), transactionSuccess, stepResult.Elapsed, 0)
transactionSuccess = true // reset flag for next transaction
}
} else if stepResult.StepType == stepTypeRendezvous {