mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-19 06:21:41 -04:00
packer_test: test build/validate with ignore flag
As we're introducing a --ignore-prerelease-plugins flag to both the validate and build subcommands, we need to make sure they work as we expect it to, so we add a test case for that.
This commit is contained in:
@@ -195,3 +195,24 @@ func (ts *PackerTestSuite) TestLoadPluginWithMetadataInName() {
|
||||
MkPipeCheck("no output in stdout").SetTester(ExpectEmptyInput()).SetStream(OnlyStdout))
|
||||
})
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestLoadWithOnlyReleaseFlag() {
|
||||
pluginPath, cleanup := ts.MakePluginDir("1.0.0", "1.0.1-dev")
|
||||
defer cleanup()
|
||||
|
||||
for _, cmd := range []string{"validate", "build"} {
|
||||
ts.Run(fmt.Sprintf("run %s without --ignore-prerelease flag - pick 1.0.1-dev by default", cmd), func() {
|
||||
ts.PackerCommand().UsePluginDir(pluginPath).
|
||||
SetArgs(cmd, "./templates/simple.pkr.hcl").
|
||||
Assert(MustSucceed(),
|
||||
Grep("packer-plugin-tester_v1.0.1-dev.*: plugin process exited", grepStderr))
|
||||
})
|
||||
|
||||
ts.Run(fmt.Sprintf("run %s with --ignore-prerelease flag - pick 1.0.0", cmd), func() {
|
||||
ts.PackerCommand().UsePluginDir(pluginPath).
|
||||
SetArgs(cmd, "--ignore-prerelease-plugins", "./templates/simple.pkr.hcl").
|
||||
Assert(MustSucceed(),
|
||||
Grep("packer-plugin-tester_v1.0.0.*: plugin process exited", grepStderr))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user