From 49e8477e9d782b1ddd849b427b05656205a3bc85 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 2 Jul 2014 10:05:39 -0700 Subject: [PATCH] config: fix order-dependent tests --- config/loader_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/loader_test.go b/config/loader_test.go index 6caf1e3c7..6742d44c2 100644 --- a/config/loader_test.go +++ b/config/loader_test.go @@ -161,7 +161,15 @@ func resourcesStr(rs []*Resource) string { if len(r.RawConfig.Variables) > 0 { result += fmt.Sprintf(" vars\n") - for _, rawV := range r.RawConfig.Variables { + + ks := make([]string, 0, len(r.RawConfig.Variables)) + for k, _ := range r.RawConfig.Variables { + ks = append(ks, k) + } + sort.Strings(ks) + + for _, k := range ks { + rawV := r.RawConfig.Variables[k] kind := "unknown" str := rawV.FullKey() @@ -227,8 +235,8 @@ aws_instance[web] network_interface security_groups vars - user: var.foo resource: aws_security_group.firewall.foo + user: var.foo ` const basicVariablesStr = `