From 51cdd9c4a9db3cdb194a02f87d889250f90045dd Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 16 May 2024 10:27:19 -0400 Subject: [PATCH] packer_test: amend installation with meta test The installation with a metadata part in the version for a plugin had one test that relied on the plugin directories being populated with packer plugins install --path. This could change in the future, while the command should remain functional, so we explicitely call it in the test instead of through the function that creates/populates a temp plugin dir. --- packer_test/install_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packer_test/install_test.go b/packer_test/install_test.go index b72d87aee..c3982e50e 100644 --- a/packer_test/install_test.go +++ b/packer_test/install_test.go @@ -1,9 +1,15 @@ package packer_test func (ts *PackerTestSuite) TestInstallPluginWithMetadata() { - tempPluginDir, cleanup := ts.MakePluginDir("1.0.0+metadata") + tempPluginDir, cleanup := ts.MakePluginDir() defer cleanup() + ts.Run("install plugin with metadata in version", func() { + ts.PackerCommand().UsePluginDir(tempPluginDir). + SetArgs("plugins", "install", "--path", BuildSimplePlugin("1.0.0+metadata", ts.T()), "github.com/hashicorp/tester"). + Assert(MustSucceed(), Grep("Successfully installed plugin", grepStdout)) + }) + ts.Run("metadata plugin installed must not have metadata in its path", func() { ts.PackerCommand().UsePluginDir(tempPluginDir). SetArgs("plugins", "installed").