From 3d437ede998119e331a7cd29daf9b5f94a040e81 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 3 May 2024 15:35:14 -0400 Subject: [PATCH] test: compile plugins on call to MakePluginDir MakePluginDir used to only load plugins that were precompiled at the start of the tests, but now when invoked with any list of plugins, this will attempt to compile plugins one-by-one, so we don't need to modify the tests in several places when running tests. There's still value in compiling the plugins in advance though: as they run in parallel, they all get compiled at once, so we shave off a few seconds from the test run. --- test/plugin_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/plugin_test.go b/test/plugin_test.go index db8b969b9..28abbf59b 100644 --- a/test/plugin_test.go +++ b/test/plugin_test.go @@ -149,6 +149,10 @@ func currentDir() (string, error) { func (ts *PackerTestSuite) MakePluginDir(pluginVersions ...string) (pluginTempDir string, cleanup func()) { t := ts.T() + for _, ver := range pluginVersions { + BuildSimplePlugin(ver, t) + } + var err error defer func() {