From aecb66d3dbdc04a05e13500fa0bbbb00cafc3e6e Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 14 Nov 2018 16:06:48 -0800 Subject: [PATCH] command: Fix TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithoutDefault As part of integrating the new "remote" backend we relaxed the requirement that a "default" workspace must exist in all backends and now skip migrating empty workspace states to avoid creating unnecessary "default" workspaces when switching between backends that require it and backends that don't, such as when switching from the local backend (which always has a "default" workspace) to Terraform Enterprise. --- command/meta_backend_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/command/meta_backend_test.go b/command/meta_backend_test.go index 6ec20aa87..d837eaff9 100644 --- a/command/meta_backend_test.go +++ b/command/meta_backend_test.go @@ -1279,9 +1279,9 @@ func TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithoutDefault(t *test } sort.Strings(workspaces) - expected := []string{"default", "env2"} + expected := []string{"env2"} // default is skipped because it is absent in the source backend if !reflect.DeepEqual(workspaces, expected) { - t.Fatalf("bad: %#v", workspaces) + t.Fatalf("wrong workspaces\ngot: %#v\nwant: %#v", workspaces, expected) } { @@ -1306,7 +1306,7 @@ func TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithoutDefault(t *test // Verify existing workspaces exist envPath := filepath.Join(backendLocal.DefaultWorkspaceDir, "env2", backendLocal.DefaultStateFilename) if _, err := os.Stat(envPath); err != nil { - t.Fatal("env should exist") + t.Fatalf("%s should exist, but does not", envPath) } } @@ -1314,7 +1314,7 @@ func TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithoutDefault(t *test // Verify new workspaces exist envPath := filepath.Join("envdir-new", "env2", backendLocal.DefaultStateFilename) if _, err := os.Stat(envPath); err != nil { - t.Fatal("env should exist") + t.Fatalf("%s should exist, but does not", envPath) } } }