From 54cdfee544ec76c3b1182530558d567fe0139606 Mon Sep 17 00:00:00 2001 From: Ross Light Date: Mon, 2 Jul 2018 14:19:19 -0700 Subject: [PATCH] wire: speed up test execution (google/go-cloud#163) 1. Runs subtests in parallel. 2. Decreases the number of runs of the Determinism test to a constant 2. --- internal/wire/wire_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/wire/wire_test.go b/internal/wire/wire_test.go index ff41144..6cee039 100644 --- a/internal/wire/wire_test.go +++ b/internal/wire/wire_test.go @@ -68,6 +68,7 @@ func TestWire(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(t *testing.T) { + t.Parallel() bctx := test.buildContext() gen, errs := Generate(bctx, wd, test.pkg) if len(gen) > 0 { @@ -131,15 +132,13 @@ func TestWire(t *testing.T) { }) t.Run("Determinism", func(t *testing.T) { - runs := 10 - if testing.Short() { - runs = 3 - } + const runs = 2 for _, test := range tests { if test.wantError { continue } t.Run(test.name, func(t *testing.T) { + t.Parallel() bctx := test.buildContext() gold, errs := Generate(bctx, wd, test.pkg) if len(errs) > 0 {