Skip to content

Commit

Permalink
change: remove defaultRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
debugtalk committed Sep 28, 2021
1 parent 3311264 commit 698733c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions boomer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 698733c

Please sign in to comment.