refactor: runStep

This commit is contained in:
debugtalk
2021-09-22 21:25:28 +08:00
parent 9fb19da2ac
commit 102b8a94a3
7 changed files with 50 additions and 56 deletions

View File

@@ -29,6 +29,7 @@ func (b *Boomer) Run(testcases ...*TestCase) {
}
func convertBoomerTask(testcase *TestCase) *boomer.Task {
runner := NewRunner()
return &boomer.Task{
Name: testcase.Config.Name,
Weight: testcase.Config.Weight,
@@ -36,7 +37,8 @@ func convertBoomerTask(testcase *TestCase) *boomer.Task {
config := &testcase.Config
for _, step := range testcase.TestSteps {
start := time.Now()
err := step.Run(config)
tStep := parseStep(step, config)
err := runner.runStep(tStep)
elapsed := time.Since(start).Nanoseconds() / int64(time.Millisecond)
if err == nil {