diff --git a/e2e/cli-plugins/main_test.go b/e2e/cli-plugins/main_test.go new file mode 100644 index 0000000000..911a5c065e --- /dev/null +++ b/e2e/cli-plugins/main_test.go @@ -0,0 +1,17 @@ +package cliplugins + +import ( + "fmt" + "os" + "testing" + + "github.com/docker/cli/internal/test/environment" +) + +func TestMain(m *testing.M) { + if err := environment.Setup(); err != nil { + fmt.Println(err.Error()) + os.Exit(3) + } + os.Exit(m.Run()) +} diff --git a/e2e/cli-plugins/run_test.go b/e2e/cli-plugins/run_test.go index 1309cc0d58..3c9426e042 100644 --- a/e2e/cli-plugins/run_test.go +++ b/e2e/cli-plugins/run_test.go @@ -135,7 +135,7 @@ func TestHelpGood(t *testing.T) { run, _, cleanup := prepare(t) defer cleanup() - res := icmd.RunCmd(run("-D", "help", "helloworld")) + res := icmd.RunCmd(run("-l", "info", "help", "helloworld")) res.Assert(t, icmd.Expected{ ExitCode: 0, Err: icmd.None, @@ -150,7 +150,7 @@ func TestGoodHelp(t *testing.T) { run, _, cleanup := prepare(t) defer cleanup() - res := icmd.RunCmd(run("-D", "helloworld", "--help")) + res := icmd.RunCmd(run("-l", "info", "helloworld", "--help")) res.Assert(t, icmd.Expected{ ExitCode: 0, Err: icmd.None, @@ -159,7 +159,7 @@ func TestGoodHelp(t *testing.T) { golden.Assert(t, res.Stdout(), "docker-help-helloworld.golden") // Short -h should be the same, modulo the deprecation message exp := shortHFlagDeprecated + res.Stdout() - res = icmd.RunCmd(run("-D", "helloworld", "-h")) + res = icmd.RunCmd(run("-l", "info", "helloworld", "-h")) res.Assert(t, icmd.Expected{ ExitCode: 0, // This should be identical to the --help case above @@ -188,7 +188,7 @@ func TestHelpGoodSubcommand(t *testing.T) { run, _, cleanup := prepare(t) defer cleanup() - res := icmd.RunCmd(run("-D", "help", "helloworld", "goodbye")) + res := icmd.RunCmd(run("-l", "info", "help", "helloworld", "goodbye")) res.Assert(t, icmd.Expected{ ExitCode: 0, Err: icmd.None, @@ -203,7 +203,7 @@ func TestGoodSubcommandHelp(t *testing.T) { run, _, cleanup := prepare(t) defer cleanup() - res := icmd.RunCmd(run("-D", "helloworld", "goodbye", "--help")) + res := icmd.RunCmd(run("-l", "info", "helloworld", "goodbye", "--help")) res.Assert(t, icmd.Expected{ ExitCode: 0, Err: icmd.None,