From 0318386272f6fa96b492c69a8eecba930f98557b Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 3 May 2024 19:33:51 +0000 Subject: [PATCH] backport of commit 848188d705c330f9badf3e7a36b20b8b97869cfc --- test/plugin_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/plugin_test.go b/test/plugin_test.go index b5aa3990d..db8b969b9 100644 --- a/test/plugin_test.go +++ b/test/plugin_test.go @@ -95,7 +95,13 @@ func BinaryName(version *version.Version) string { // // The path to the plugin is returned, it won't be removed automatically // though, deletion is the caller's responsibility. -func BuildSimplePlugin(versionString string, t *testing.T) { +func BuildSimplePlugin(versionString string, t *testing.T) string { + // Only build plugin binary if not already done beforehand + path, ok := LoadPluginVersion(versionString) + if ok { + return path + } + v := version.Must(version.NewSemver(versionString)) t.Logf("Building plugin in version %v", v) @@ -115,6 +121,8 @@ func BuildSimplePlugin(versionString string, t *testing.T) { } StorePluginVersion(v.String(), outBin) + + return outBin } // currentDir returns the directory in which the current file is located.