test: add NoVerbose function on PackerCommand

By default PackerCommands are run with PACKER_LOG=1.
If for any reason we don't want that, we can remove it from the
environment so we only see the user-facing logs.
pull/12983/head
Lucas Bajolet 2 years ago
parent b41c052c84
commit 0a5bdb5b78

@ -33,6 +33,15 @@ func (ts *PackerTestSuite) PackerCommand() *packerCommand {
}
}
// NoVerbose removes the `PACKER_LOG=1` environment variable from the command
func (pc *packerCommand) NoVerbose() *packerCommand {
_, ok := pc.env["PACKER_LOG"]
if ok {
delete(pc.env, "PACKER_LOG")
}
return pc
}
// UsePluginDir sets the plugin directory in the environment to `dir`
func (pc *packerCommand) UsePluginDir(dir string) *packerCommand {
return pc.AddEnv("PACKER_PLUGIN_PATH", dir)

Loading…
Cancel
Save