Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 8406d10

Browse files
committed
cmd/dep: fix setting importer tests as parallel
Use the test helper so that it can check for any problems up-front.
1 parent 9db233a commit 8406d10

6 files changed

+7
-14
lines changed

cmd/dep/base_importer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ func TestBaseImporter_ImportProjects(t *testing.T) {
396396
name := name
397397
tc := tc
398398
t.Run(name, func(t *testing.T) {
399-
t.Parallel()
400-
401399
err := tc.Exec(t, func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error) {
402400
i := newBaseImporter(logger, true, sm)
403401
convertErr := i.importPackages(tc.projects, tc.defaultConstraintFromLock)
@@ -426,6 +424,7 @@ type convertTestCase struct {
426424
func (tc convertTestCase) Exec(t *testing.T, convert func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error)) error {
427425
h := test.NewHelper(t)
428426
defer h.Cleanup()
427+
h.Parallel()
429428

430429
ctx := newTestContext(h)
431430
sm, err := ctx.SourceManager()

cmd/dep/glide_importer_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ func TestGlideConfig_Convert(t *testing.T) {
176176
name := name
177177
testCase := testCase
178178
t.Run(name, func(t *testing.T) {
179-
t.Parallel()
180-
181179
err := testCase.Exec(t, func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error) {
182180
g := newGlideImporter(logger, true, sm)
183181
g.glideConfig = testCase.yaml

cmd/dep/godep_importer_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ func TestGodepConfig_Convert(t *testing.T) {
8080
name := name
8181
testCase := testCase
8282
t.Run(name, func(t *testing.T) {
83-
t.Parallel()
84-
8583
err := testCase.Exec(t, func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error) {
8684
g := newGodepImporter(logger, true, sm)
8785
g.json = testCase.json

cmd/dep/gopath_scanner_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ const testProject1 string = "github.com/sdboyer/deptest"
1717
const testProject2 string = "github.com/sdboyer/deptestdos"
1818

1919
func TestGopathScanner_OverlayManifestConstraints(t *testing.T) {
20-
t.Parallel()
21-
2220
h := test.NewHelper(t)
21+
h.Parallel()
22+
defer h.Cleanup()
23+
2324
ctx := newTestContext(h)
2425

2526
pi1 := gps.ProjectIdentifier{ProjectRoot: gps.ProjectRoot(testProject1)}
@@ -69,9 +70,10 @@ func TestGopathScanner_OverlayManifestConstraints(t *testing.T) {
6970
}
7071

7172
func TestGopathScanner_OverlayLockProjects(t *testing.T) {
72-
t.Parallel()
73-
7473
h := test.NewHelper(t)
74+
h.Parallel()
75+
defer h.Cleanup()
76+
7577
ctx := newTestContext(h)
7678

7779
rootM := dep.NewManifest()

cmd/dep/govend_importer_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ func TestGovendConfig_Convert(t *testing.T) {
6767
name := name
6868
testCase := testCase
6969
t.Run(name, func(t *testing.T) {
70-
t.Parallel()
71-
7270
err := testCase.Exec(t, func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error) {
7371
g := newGovendImporter(logger, true, sm)
7472
g.yaml = testCase.yaml

cmd/dep/vndr_importer_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ func TestVndrConfig_Convert(t *testing.T) {
5757
name := name
5858
testCase := testCase
5959
t.Run(name, func(t *testing.T) {
60-
t.Parallel()
61-
6260
err := testCase.Exec(t, func(logger *log.Logger, sm gps.SourceManager) (*dep.Manifest, *dep.Lock, error) {
6361
g := newVndrImporter(logger, true, sm)
6462
g.packages = testCase.packages

0 commit comments

Comments
 (0)