diff --git a/boomer.go b/boomer.go index dce0163..5053110 100644 --- a/boomer.go +++ b/boomer.go @@ -37,8 +37,7 @@ func (b *Boomer) Run(testcases ...*TestCase) { } func (b *Boomer) convertBoomerTask(testcase *TestCase) *boomer.Task { - runner := NewRunner() - runner = runner.SetDebug(b.debug) + runner := NewRunner().SetDebug(b.debug) return &boomer.Task{ Name: testcase.Config.Name, Weight: testcase.Config.Weight, diff --git a/runner.go b/runner.go index d8779c2..9ac2ff5 100644 --- a/runner.go +++ b/runner.go @@ -8,10 +8,8 @@ import ( "github.com/imroc/req" ) -var defaultRunner = NewRunner() - func Test(t *testing.T, testcases ...*TestCase) error { - return defaultRunner.WithTestingT(t).Run(testcases...) + return NewRunner().WithTestingT(t).SetDebug(true).Run(testcases...) } func NewRunner() *Runner { diff --git a/step_test.go b/step_test.go index 09d42d3..f6d00e9 100644 --- a/step_test.go +++ b/step_test.go @@ -77,10 +77,11 @@ func TestRunRequestRun(t *testing.T) { config := &TConfig{ BaseURL: "https://postman-echo.com", } - if err := defaultRunner.WithTestingT(t).SetDebug(true).runStep(stepGET, config); err != nil { + runner := NewRunner().SetDebug(true).WithTestingT(t) + if err := runner.runStep(stepGET, config); err != nil { t.Fatalf("tStep.Run() error: %s", err) } - if err := defaultRunner.WithTestingT(t).SetDebug(true).runStep(stepPOSTData, config); err != nil { + if err := runner.runStep(stepPOSTData, config); err != nil { t.Fatalf("tStepPOSTData.Run() error: %s", err) } }