浏览代码

Moving last things from /tests, removing dead code

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif 4 年之前
父节点
当前提交
6859413a5d

+ 1 - 1
aci/e2e/e2e-aci_test.go

@@ -54,7 +54,7 @@ import (
 	"github.com/docker/compose-cli/api/context/store"
 	"github.com/docker/compose-cli/api/errdefs"
 	"github.com/docker/compose-cli/cli/cmd"
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 const (

+ 1 - 1
ecs/e2e/ecs-local/context_test.go

@@ -23,7 +23,7 @@ import (
 
 	"gotest.tools/v3/icmd"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 const (

+ 1 - 1
ecs/e2e/ecs/e2e-ecs_test.go

@@ -31,7 +31,7 @@ import (
 	"gotest.tools/v3/icmd"
 	"gotest.tools/v3/poll"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 var binDir string

+ 1 - 1
local/e2e/cli-only/e2e_test.go

@@ -30,7 +30,7 @@ import (
 	"gotest.tools/v3/golden"
 	"gotest.tools/v3/icmd"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 var binDir string

+ 1 - 1
tests/framework/mockmetrics.go → local/e2e/cli-only/mockmetrics.go

@@ -14,7 +14,7 @@
    limitations under the License.
 */
 
-package framework
+package main
 
 import (
 	"io/ioutil"

+ 1 - 1
local/e2e/compose/compose_test.go

@@ -27,7 +27,7 @@ import (
 	"gotest.tools/v3/assert"
 	"gotest.tools/v3/icmd"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 var binDir string

+ 1 - 1
local/e2e/compose/logs_test.go

@@ -24,7 +24,7 @@ import (
 
 	"gotest.tools/v3/icmd"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 func TestLocalComposeLogs(t *testing.T) {

+ 1 - 1
local/e2e/container/container_test.go

@@ -29,7 +29,7 @@ import (
 	"gotest.tools/v3/poll"
 
 	"github.com/docker/compose-cli/cli/cmd"
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 var binDir string

+ 1 - 1
local/e2e/container/skip_win_ci_test.go

@@ -30,7 +30,7 @@ import (
 	"gotest.tools/v3/icmd"
 	"gotest.tools/v3/poll"
 
-	. "github.com/docker/compose-cli/tests/framework"
+	. "github.com/docker/compose-cli/utils/e2e"
 )
 
 func TestKillChildProcess(t *testing.T) {

+ 0 - 5
tests/composefiles/nginx.yaml

@@ -1,5 +0,0 @@
-services:
-  nginx:
-    image: nginx
-    ports:
-      - "80:80"

+ 0 - 42
tests/framework/unit.go

@@ -1,42 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package framework
-
-import (
-	"context"
-	"io/ioutil"
-	"os"
-)
-
-// TestCLI is a helper struct for CLI tests.
-type TestCLI struct {
-	ctx    context.Context
-	writer *os.File
-	reader *os.File
-}
-
-// Context returns a configured context
-func (c *TestCLI) Context() context.Context {
-	return c.ctx
-}
-
-// GetStdOut returns the output of the command
-func (c *TestCLI) GetStdOut() string {
-	_ = c.writer.Close()
-	out, _ := ioutil.ReadAll(c.reader)
-	return string(out)
-}

+ 2 - 1
tests/framework/e2e.go → utils/e2e/framework.go

@@ -14,7 +14,7 @@
    limitations under the License.
 */
 
-package framework
+package e2e
 
 import (
 	"errors"
@@ -51,6 +51,7 @@ func init() {
 }
 
 // E2eCLI is used to wrap the CLI for end to end testing
+// nolint stutter
 type E2eCLI struct {
 	BinDir    string
 	ConfigDir string