cli
cli copied to clipboard
Running an experimental plugin with non experimental CLI should show a friendly message
Description Running an experimental plugin with non experimental CLI should show a friendly message. The code seams to be here already, but something is short-circuiting it.
Steps to reproduce the issue:
Wrote some e2e tests in e2e/cli-plugins/run_test.go:
// TestPluginExperimentalWithNonExperimentalCLI tests when the plugin is labelled as experimental but
// not the CLI, which should print a message asking the user to activate experimental mode.
func TestPluginExperimentalWithNonExperimentalCLI(t *testing.T) {
run, cfg, cleanup := prepare(t)
defer cleanup()
cfg.Experimental = "disabled"
err := cfg.Save()
assert.NilError(t, err)
cmd := run("helloworld")
cmd.Env = append(os.Environ(), "HELLO_EXPERIMENTAL=enabled")
res := icmd.RunCmd(cmd)
res.Assert(t, icmd.Expected{
ExitCode: 1,
Out: icmd.None,
Err: "plugin candidate helloworld: requires experimental CLI",
})
}
// TestPluginExperimentalWithExperimentalCLI tests when the plugin is labelled as experimental and
// the CLI too. The plugin should just work fine.
func TestPluginExperimentalWithExperimentalCLI(t *testing.T) {
run, cfg, cleanup := prepare(t)
defer cleanup()
cfg.Experimental = "enabled"
err := cfg.Save()
assert.NilError(t, err)
cmd := run("helloworld")
cmd.Env = append(os.Environ(), "HELLO_EXPERIMENTAL=enabled")
res := icmd.RunCmd(cmd)
res.Assert(t, icmd.Expected{
ExitCode: 0,
Out: "Hello World!",
Err: icmd.None,
})
}
(paste your output here)
Additional environment details (AWS, VirtualBox, physical, etc.):
/cc @tiborvass @andrewhsu