add e2e test for compose up on default context

Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
aiordache 2020-07-29 14:43:41 +02:00
Родитель 5a26b25709
Коммит 648f0139df
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -17,12 +17,12 @@
package compose
import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
apicontext "github.com/docker/api/context"
"github.com/docker/api/context/store"
"github.com/docker/api/errdefs"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
// Command returns the compose command with its child commands

Просмотреть файл

@ -86,6 +86,15 @@ func (s *E2eSuite) TestContextLsFormat() {
Expect(output).To(ContainSubstring(`"Name":"default"`))
}
func (s *E2eSuite) TestComposeOnDefaultContext() {
s.NewDockerCommand("context", "use", "default").ExecOrDie()
output := s.NewDockerCommand("context", "inspect").ExecOrDie()
Expect(output).To(ContainSubstring(`"Name": "default"`))
output, err := s.NewDockerCommand("compose", "up").Exec()
Expect(err).NotTo(BeNil())
Expect(output).To(ContainSubstring(`compose command not supported on context type`))
}
func (s *E2eSuite) TestContextCreateParseErrorDoesNotDelegateToLegacy() {
s.Step("should dispay new cli error when parsing context create flags", func() {
_, err := s.NewDockerCommand("context", "create", "aci", "--subscription-id", "titi").Exec()