Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: actually set parallel to true by default #33

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type suite struct {

func TestApi(t *testing.T) {
scope := &suite{TestingT: t, resp: httptest.NewRecorder()}
run := gocuke.NewRunner(t, scope)
run := gocuke.
NewRunner(t, scope).
NonParallel()
run.Before(func() {
scope.resp = httptest.NewRecorder()
})
Expand Down
11 changes: 7 additions & 4 deletions hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestHooks(t *testing.T) {
NewRunner(t, &hooksSuite{}).
Path("features/hooks.feature").
Tags("@long").
NonParallel().
Run()
assert.Assert(t, longRun)
assert.Assert(t, !shortRun)
Expand All @@ -25,6 +26,7 @@ func TestHooks(t *testing.T) {
NewRunner(t, &hooksSuite{}).
Path("features/hooks.feature").
ShortTags("not @long").
NonParallel().
Run()

assert.Assert(t, longRun)
Expand All @@ -33,12 +35,13 @@ func TestHooks(t *testing.T) {
if open != 0 {
t.Fatalf("expected 0 open resources, got: %d", open)
}

}

var longRun = false
var shortRun = false
var open int64 = 0
var (
longRun = false
shortRun = false
open int64 = 0
)

type hooksSuite struct {
TestingT
Expand Down
2 changes: 1 addition & 1 deletion runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewRunner(t *testing.T, suiteType interface{}) *Runner {
r := &Runner{
topLevelT: t,
incr: &messages.Incrementing{},
parallel: false,
parallel: true,
haveSuggestion: map[string]bool{},
supportedSpecialArgs: map[reflect.Type]specialArgGetter{
// TestingT
Expand Down
6 changes: 5 additions & 1 deletion simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ func (s *simpleSuite) IHaveLeft(a int64) {

// test if a struct that doesn't use a pointer and a global var
func TestSimpleNonPointer(t *testing.T) {
gocuke.NewRunner(t, simpleSuiteNP{}).Path("examples/simple/simple.feature").Run()
gocuke.
NewRunner(t, simpleSuiteNP{}).
Path("examples/simple/simple.feature").
NonParallel().
Run()
}

var globalCukes int64
Expand Down
Loading