compose/ecs/tests/setup_command_test.go
Guillaume Lours e9fe3b2864
Add e2e test deploying a compose application to an ECS cluster
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:55 +02:00

25 lines
653 B
Go

package tests
import (
"strings"
"testing"
"gotest.tools/assert"
"gotest.tools/v3/golden"
"gotest.tools/v3/icmd"
)
func TestDefaultAwsContextName(t *testing.T) {
cmd, cleanup, _ := dockerCli.createTestCmd()
defer cleanup()
cmd.Command = dockerCli.Command("ecs", "setup", "--cluster", "clusterName", "--profile", "profileName",
"--region", "regionName")
icmd.RunCmd(cmd).Assert(t, icmd.Success)
cmd.Command = dockerCli.Command("context", "inspect", "aws")
output := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
expected := golden.Get(t, "context-inspect.golden")
assert.Assert(t, strings.HasPrefix(output, string(expected)))
}