perf(test): check tool versions in parallel

This commit is contained in:
Khue Doan 2022-10-03 13:01:57 +07:00
parent a5a6db14b6
commit 507118385c

View File

@ -30,13 +30,17 @@ func TestToolsVersions(t *testing.T) {
} }
for _, tool := range tools { for _, tool := range tools {
params := version_checker.CheckVersionParams{ tool := tool // https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
BinaryPath: tool.binaryPath, t.Run(tool.binaryPath, func(t *testing.T) {
VersionConstraint: tool.versionConstraint, t.Parallel()
WorkingDir: ".", params := version_checker.CheckVersionParams{
} BinaryPath: tool.binaryPath,
VersionConstraint: tool.versionConstraint,
WorkingDir: ".",
}
version_checker.CheckVersion(t, params) version_checker.CheckVersion(t, params)
})
} }
} }