From 906e434be5f1cf33751d3ce76523c520ddd34540 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Tue, 2 Feb 2021 20:14:23 -0300 Subject: [PATCH] Fix golden files usage This follows https://github.com/docker/compose-cli/pull/1220/files Signed-off-by: Ulysses Souza --- ecs/context_test.go | 16 ++++++++-------- ...nfig.golden => context-by-keys-config.golden} | 0 ...golden => context-by-keys-credentials.golden} | 0 ...g.golden => context-by-profile-config.golden} | 0 ...den => context-by-profile-credentials.golden} | 0 5 files changed, 8 insertions(+), 8 deletions(-) rename ecs/testdata/{context/by-keys/config.golden => context-by-keys-config.golden} (100%) rename ecs/testdata/{context/by-keys/credentials.golden => context-by-keys-credentials.golden} (100%) rename ecs/testdata/{context/by-profile/config.golden => context-by-profile-config.golden} (100%) rename ecs/testdata/{context/by-profile/credentials.golden => context-by-profile-credentials.golden} (100%) diff --git a/ecs/context_test.go b/ecs/context_test.go index f196edc40..9982a54fe 100644 --- a/ecs/context_test.go +++ b/ecs/context_test.go @@ -65,15 +65,15 @@ func TestCreateContextDataByKeys(t *testing.T) { assert.Equal(t, data.(store.EcsContext).Profile, "default") s := golden.Get(t, dir.Join("config")) - golden.Assert(t, string(s), "context/by-keys/config.golden") + golden.Assert(t, string(s), "context-by-keys-config.golden") s = golden.Get(t, dir.Join("credentials")) - golden.Assert(t, string(s), "context/by-keys/credentials.golden") + golden.Assert(t, string(s), "context-by-keys-credentials.golden") } func TestCreateContextDataFromProfile(t *testing.T) { - os.Setenv("AWS_CONFIG_FILE", "testdata/context/by-profile/config.golden") // nolint:errcheck - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/context/by-profile/credentials.golden") // nolint:errcheck + os.Setenv("AWS_CONFIG_FILE", "testdata/context-by-profile-config.golden") // nolint:errcheck + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/context-by-profile-credentials.golden") // nolint:errcheck defer os.Unsetenv("AWS_CONFIG_FILE") // nolint:errcheck defer os.Unsetenv("AWS_SHARED_CREDENTIALS_FILE") // nolint:errcheck @@ -144,15 +144,15 @@ func TestCreateContextDataByKeysInteractive(t *testing.T) { assert.Equal(t, data.(store.EcsContext).Profile, "default") s := golden.Get(t, dir.Join("config")) - golden.Assert(t, string(s), "context/by-keys/config.golden") + golden.Assert(t, string(s), "context-by-keys-config.golden") s = golden.Get(t, dir.Join("credentials")) - golden.Assert(t, string(s), "context/by-keys/credentials.golden") + golden.Assert(t, string(s), "context-by-keys-credentials.golden") } func TestCreateContextDataByProfileInteractive(t *testing.T) { - os.Setenv("AWS_CONFIG_FILE", "testdata/context/by-profile/config.golden") // nolint:errcheck - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/context/by-profile/credentials.golden") // nolint:errcheck + os.Setenv("AWS_CONFIG_FILE", "testdata/context-by-profile-config.golden") // nolint:errcheck + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/context-by-profile-credentials.golden") // nolint:errcheck defer os.Unsetenv("AWS_CONFIG_FILE") // nolint:errcheck defer os.Unsetenv("AWS_SHARED_CREDENTIALS_FILE") // nolint:errcheck diff --git a/ecs/testdata/context/by-keys/config.golden b/ecs/testdata/context-by-keys-config.golden similarity index 100% rename from ecs/testdata/context/by-keys/config.golden rename to ecs/testdata/context-by-keys-config.golden diff --git a/ecs/testdata/context/by-keys/credentials.golden b/ecs/testdata/context-by-keys-credentials.golden similarity index 100% rename from ecs/testdata/context/by-keys/credentials.golden rename to ecs/testdata/context-by-keys-credentials.golden diff --git a/ecs/testdata/context/by-profile/config.golden b/ecs/testdata/context-by-profile-config.golden similarity index 100% rename from ecs/testdata/context/by-profile/config.golden rename to ecs/testdata/context-by-profile-config.golden diff --git a/ecs/testdata/context/by-profile/credentials.golden b/ecs/testdata/context-by-profile-credentials.golden similarity index 100% rename from ecs/testdata/context/by-profile/credentials.golden rename to ecs/testdata/context-by-profile-credentials.golden