From 507118385c8f3ecbb0031d2539573886a353ebbb Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Mon, 3 Oct 2022 13:01:57 +0700 Subject: [PATCH] perf(test): check tool versions in parallel --- test/tools_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/tools_test.go b/test/tools_test.go index cf3ac9e5..ab9e8ffc 100644 --- a/test/tools_test.go +++ b/test/tools_test.go @@ -30,13 +30,17 @@ func TestToolsVersions(t *testing.T) { } for _, tool := range tools { - params := version_checker.CheckVersionParams{ - BinaryPath: tool.binaryPath, - VersionConstraint: tool.versionConstraint, - WorkingDir: ".", - } + tool := tool // https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables + t.Run(tool.binaryPath, func(t *testing.T) { + t.Parallel() + params := version_checker.CheckVersionParams{ + BinaryPath: tool.binaryPath, + VersionConstraint: tool.versionConstraint, + WorkingDir: ".", + } - version_checker.CheckVersion(t, params) + version_checker.CheckVersion(t, params) + }) } }