Merge pull request #8316 from alrs/prune-packer-dead-code
packer: Prune Dead Code, Pick Up Dropped Err
This commit is contained in:
commit
ac1e628f6f
|
@ -42,7 +42,7 @@ func TestExpandUser_Empty(t *testing.T) {
|
|||
var path, expected string
|
||||
|
||||
// Try an invalid user
|
||||
path, err := ExpandUser("~invalid-user-that-should-not-exist")
|
||||
_, err := ExpandUser("~invalid-user-that-should-not-exist")
|
||||
if err == nil {
|
||||
t.Fatalf("expected failure")
|
||||
}
|
||||
|
|
|
@ -407,7 +407,7 @@ func (c *Core) init() error {
|
|||
}
|
||||
}
|
||||
|
||||
if (changed == false) && (shouldRetry == true) {
|
||||
if !changed && shouldRetry {
|
||||
return fmt.Errorf("Failed to interpolate %s: Please make sure that "+
|
||||
"the variable you're referencing has been defined; Packer treats "+
|
||||
"all variables used to interpolate other user varaibles as "+
|
||||
|
|
|
@ -670,17 +670,6 @@ func TestSensitiveVars(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func testComponentFinder() *ComponentFinder {
|
||||
builderFactory := func(n string) (Builder, error) { return new(MockBuilder), nil }
|
||||
ppFactory := func(n string) (PostProcessor, error) { return new(MockPostProcessor), nil }
|
||||
provFactory := func(n string) (Provisioner, error) { return new(MockProvisioner), nil }
|
||||
return &ComponentFinder{
|
||||
Builder: builderFactory,
|
||||
PostProcessor: ppFactory,
|
||||
Provisioner: provFactory,
|
||||
}
|
||||
}
|
||||
|
||||
func testCoreTemplate(t *testing.T, c *CoreConfig, p string) {
|
||||
tpl, err := template.ParseFile(p)
|
||||
if err != nil {
|
||||
|
|
|
@ -21,7 +21,6 @@ type testBuild struct {
|
|||
setDebugCalled bool
|
||||
setForceCalled bool
|
||||
setOnErrorCalled bool
|
||||
cancelCalled bool
|
||||
|
||||
errRunResult bool
|
||||
}
|
||||
|
|
|
@ -112,6 +112,9 @@ func TestPostProcessorRPC_cancel(t *testing.T) {
|
|||
// Test Configure
|
||||
config := 42
|
||||
err := ppClient.Configure(config)
|
||||
if err != nil {
|
||||
t.Fatalf("error configuring post-processor client: %s", err)
|
||||
}
|
||||
|
||||
// Test PostProcess
|
||||
a := &packer.MockArtifact{
|
||||
|
|
Loading…
Reference in New Issue