builder/*: fix flaky tests, get tests passing

This commit is contained in:
Mitchell Hashimoto 2014-09-04 18:11:05 -07:00
parent 5f5e94711c
commit 77bd024079
2 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ func (a *Artifact) Id() string {
parts = append(parts, fmt.Sprintf("%s:%s", region, amiId)) parts = append(parts, fmt.Sprintf("%s:%s", region, amiId))
} }
sort.Strings(parts)
return strings.Join(parts, ",") return strings.Join(parts, ",")
} }
@ -47,7 +48,7 @@ func (a *Artifact) String() string {
amiStrings = append(amiStrings, single) amiStrings = append(amiStrings, single)
} }
sort.Sort(sort.StringSlice(amiStrings)) sort.Strings(amiStrings)
return fmt.Sprintf("AMIs were created:\n\n%s", strings.Join(amiStrings, "\n")) return fmt.Sprintf("AMIs were created:\n\n%s", strings.Join(amiStrings, "\n"))
} }

View File

@ -46,7 +46,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Errorf("bad guest OS type: %s", b.config.GuestOSType) t.Errorf("bad guest OS type: %s", b.config.GuestOSType)
} }
if b.config.VMName != "packer-foo" { if b.config.VMName == "" {
t.Errorf("bad vm name: %s", b.config.VMName) t.Errorf("bad vm name: %s", b.config.VMName)
} }