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.
pull/13032/head
Lucas Bajolet 2 years ago committed by Lucas Bajolet
parent fc056a4594
commit 3d437ede99

@ -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() {

Loading…
Cancel
Save