1
0
Эх сурвалжийг харах

add e2e test for compose up on default context

Signed-off-by: aiordache <[email protected]>
aiordache 5 жил өмнө
parent
commit
648f0139df

+ 3 - 3
cli/cmd/compose/compose.go

@@ -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

+ 9 - 0
tests/e2e/e2e_test.go

@@ -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()