github.com/ali-iotechsys/cli@v20.10.0+incompatible/e2e/stack/help_test.go (about) 1 package stack 2 3 import ( 4 "fmt" 5 "testing" 6 7 "gotest.tools/v3/golden" 8 "gotest.tools/v3/icmd" 9 ) 10 11 func TestStackDeployHelp(t *testing.T) { 12 t.Run("Swarm", func(t *testing.T) { 13 testStackDeployHelp(t, "swarm") 14 }) 15 t.Run("Kubernetes", func(t *testing.T) { 16 testStackDeployHelp(t, "kubernetes") 17 }) 18 } 19 20 func testStackDeployHelp(t *testing.T, orchestrator string) { 21 result := icmd.RunCommand("docker", "stack", "deploy", "--orchestrator", orchestrator, "--help") 22 result.Assert(t, icmd.Success) 23 golden.Assert(t, result.Stdout(), fmt.Sprintf("stack-deploy-help-%s.golden", orchestrator)) 24 }