From a9f3de84e1a83aa0e0f250256e86e61ca9179d49 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Thu, 1 Dec 2016 12:50:41 -0700 Subject: [PATCH] fix(hel): fix plugin format on tests Test plugins were in the original format. Updated to current format and fixed the tests to stop silently ignoring the broken test. --- cmd/helm/plugins_test.go | 7 ++++++- cmd/helm/testdata/helmhome/plugins/{ => args}/args.sh | 0 .../helmhome/plugins/{args.yaml => args/plugin.yaml} | 2 +- .../helmhome/plugins/{echo.yaml => echo/plugin.yaml} | 0 .../helmhome/plugins/{env.yaml => env/plugin.yaml} | 0 .../testdata/helmhome/plugins/{ => fullenv}/fullenv.sh | 2 +- .../helmhome/plugins/{fullenv.yaml => fullenv/plugin.yaml} | 2 +- 7 files changed, 9 insertions(+), 4 deletions(-) rename cmd/helm/testdata/helmhome/plugins/{ => args}/args.sh (100%) rename cmd/helm/testdata/helmhome/plugins/{args.yaml => args/plugin.yaml} (61%) rename cmd/helm/testdata/helmhome/plugins/{echo.yaml => echo/plugin.yaml} (100%) rename cmd/helm/testdata/helmhome/plugins/{env.yaml => env/plugin.yaml} (100%) rename cmd/helm/testdata/helmhome/plugins/{ => fullenv}/fullenv.sh (87%) rename cmd/helm/testdata/helmhome/plugins/{fullenv.yaml => fullenv/plugin.yaml} (63%) diff --git a/cmd/helm/plugins_test.go b/cmd/helm/plugins_test.go index 77828ea3b..55c36c2f6 100644 --- a/cmd/helm/plugins_test.go +++ b/cmd/helm/plugins_test.go @@ -77,7 +77,7 @@ func TestLoadPlugins(t *testing.T) { envs := strings.Join([]string{ "fullenv", - "fullenv.yaml", + hh.Plugins() + "/fullenv", hh.Plugins(), hh.String(), hh.Repository(), @@ -102,6 +102,11 @@ func TestLoadPlugins(t *testing.T) { } plugins := cmd.Commands() + + if len(plugins) != len(tests) { + t.Fatalf("Expected %d plugins, got %d", len(tests), len(plugins)) + } + for i := 0; i < len(plugins); i++ { out.Reset() tt := tests[i] diff --git a/cmd/helm/testdata/helmhome/plugins/args.sh b/cmd/helm/testdata/helmhome/plugins/args/args.sh similarity index 100% rename from cmd/helm/testdata/helmhome/plugins/args.sh rename to cmd/helm/testdata/helmhome/plugins/args/args.sh diff --git a/cmd/helm/testdata/helmhome/plugins/args.yaml b/cmd/helm/testdata/helmhome/plugins/args/plugin.yaml similarity index 61% rename from cmd/helm/testdata/helmhome/plugins/args.yaml rename to cmd/helm/testdata/helmhome/plugins/args/plugin.yaml index dbea13673..21e28a7c2 100644 --- a/cmd/helm/testdata/helmhome/plugins/args.yaml +++ b/cmd/helm/testdata/helmhome/plugins/args/plugin.yaml @@ -1,4 +1,4 @@ name: args usage: "echo args" description: "This echos args" -command: "$HELM_HOME/plugins/args.sh" +command: "$HELM_PLUGIN_DIR/args.sh" diff --git a/cmd/helm/testdata/helmhome/plugins/echo.yaml b/cmd/helm/testdata/helmhome/plugins/echo/plugin.yaml similarity index 100% rename from cmd/helm/testdata/helmhome/plugins/echo.yaml rename to cmd/helm/testdata/helmhome/plugins/echo/plugin.yaml diff --git a/cmd/helm/testdata/helmhome/plugins/env.yaml b/cmd/helm/testdata/helmhome/plugins/env/plugin.yaml similarity index 100% rename from cmd/helm/testdata/helmhome/plugins/env.yaml rename to cmd/helm/testdata/helmhome/plugins/env/plugin.yaml diff --git a/cmd/helm/testdata/helmhome/plugins/fullenv.sh b/cmd/helm/testdata/helmhome/plugins/fullenv/fullenv.sh similarity index 87% rename from cmd/helm/testdata/helmhome/plugins/fullenv.sh rename to cmd/helm/testdata/helmhome/plugins/fullenv/fullenv.sh index e72047333..518f492e9 100755 --- a/cmd/helm/testdata/helmhome/plugins/fullenv.sh +++ b/cmd/helm/testdata/helmhome/plugins/fullenv/fullenv.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo $HELM_PLUGIN_SHORTNAME echo $HELM_PLUGIN_NAME +echo $HELM_PLUGIN_DIR echo $HELM_PLUGIN echo $HELM_HOME echo $HELM_PATH_REPOSITORY diff --git a/cmd/helm/testdata/helmhome/plugins/fullenv.yaml b/cmd/helm/testdata/helmhome/plugins/fullenv/plugin.yaml similarity index 63% rename from cmd/helm/testdata/helmhome/plugins/fullenv.yaml rename to cmd/helm/testdata/helmhome/plugins/fullenv/plugin.yaml index a6f4c5a4e..63f2f12db 100644 --- a/cmd/helm/testdata/helmhome/plugins/fullenv.yaml +++ b/cmd/helm/testdata/helmhome/plugins/fullenv/plugin.yaml @@ -1,4 +1,4 @@ name: fullenv usage: "show env vars" description: "show all env vars" -command: "$HELM_HOME/plugins/fullenv.sh" +command: "$HELM_PLUGIN_DIR/fullenv.sh"