mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 01:30:06 -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:
parent
66e70a863d
commit
7124cf81fa
1 changed files with 21 additions and 0 deletions
|
|
@ -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))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue