Skip to content

Commit ae1ad2e

Browse files
authored
fix: actually set parallel to true by default (#33)
Resolves #32
1 parent 8921eae commit ae1ad2e

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

examples/api/api_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ type suite struct {
2020

2121
func TestApi(t *testing.T) {
2222
scope := &suite{TestingT: t, resp: httptest.NewRecorder()}
23-
run := gocuke.NewRunner(t, scope)
23+
run := gocuke.
24+
NewRunner(t, scope).
25+
NonParallel()
2426
run.Before(func() {
2527
scope.resp = httptest.NewRecorder()
2628
})

hooks_test.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func TestHooks(t *testing.T) {
1414
NewRunner(t, &hooksSuite{}).
1515
Path("features/hooks.feature").
1616
Tags("@long").
17+
NonParallel().
1718
Run()
1819
assert.Assert(t, longRun)
1920
assert.Assert(t, !shortRun)
@@ -25,6 +26,7 @@ func TestHooks(t *testing.T) {
2526
NewRunner(t, &hooksSuite{}).
2627
Path("features/hooks.feature").
2728
ShortTags("not @long").
29+
NonParallel().
2830
Run()
2931

3032
assert.Assert(t, longRun)
@@ -33,12 +35,13 @@ func TestHooks(t *testing.T) {
3335
if open != 0 {
3436
t.Fatalf("expected 0 open resources, got: %d", open)
3537
}
36-
3738
}
3839

39-
var longRun = false
40-
var shortRun = false
41-
var open int64 = 0
40+
var (
41+
longRun = false
42+
shortRun = false
43+
open int64 = 0
44+
)
4245

4346
type hooksSuite struct {
4447
TestingT

runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func NewRunner(t *testing.T, suiteType interface{}) *Runner {
5959
r := &Runner{
6060
topLevelT: t,
6161
incr: &messages.Incrementing{},
62-
parallel: false,
62+
parallel: true,
6363
haveSuggestion: map[string]bool{},
6464
supportedSpecialArgs: map[reflect.Type]specialArgGetter{
6565
// TestingT

simple_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ func (s *simpleSuite) IHaveLeft(a int64) {
3131

3232
// test if a struct that doesn't use a pointer and a global var
3333
func TestSimpleNonPointer(t *testing.T) {
34-
gocuke.NewRunner(t, simpleSuiteNP{}).Path("examples/simple/simple.feature").Run()
34+
gocuke.
35+
NewRunner(t, simpleSuiteNP{}).
36+
Path("examples/simple/simple.feature").
37+
NonParallel().
38+
Run()
3539
}
3640

3741
var globalCukes int64

0 commit comments

Comments
 (0)